bitkeeper revision 1.1159.142.4 (4184b6d4rc3Jd2irJimPyupm4TO06A)
authorkaf24@freefall.cl.cam.ac.uk <kaf24@freefall.cl.cam.ac.uk>
Sun, 31 Oct 2004 09:56:36 +0000 (09:56 +0000)
committerkaf24@freefall.cl.cam.ac.uk <kaf24@freefall.cl.cam.ac.uk>
Sun, 31 Oct 2004 09:56:36 +0000 (09:56 +0000)
Rename Xen public interfaces.
 1. hypervisor-if.h is now xen.h
 2. hypervisor-ifs/ directory is now:
     <include/public/...> in Xen
     <asm/xen-public/...> in Linux
     <xen/...> in user space

97 files changed:
.rootkeys
COPYING
docs/misc/blkif-drivers-explained.txt
docs/src/interface.tex
extras/mini-os/Makefile
extras/mini-os/h/events.h
extras/mini-os/h/hypervisor.h
extras/mini-os/h/os.h
linux-2.4.27-xen-sparse/arch/xen/Makefile
linux-2.4.27-xen-sparse/arch/xen/drivers/blkif/frontend/common.h
linux-2.4.27-xen-sparse/arch/xen/kernel/pci-pc.c
linux-2.4.27-xen-sparse/arch/xen/kernel/process.c
linux-2.4.27-xen-sparse/arch/xen/kernel/setup.c
linux-2.4.27-xen-sparse/arch/xen/kernel/time.c
linux-2.4.27-xen-sparse/include/asm-xen/page.h
linux-2.4.27-xen-sparse/include/asm-xen/segment.h
linux-2.4.27-xen-sparse/mkbuildtree
linux-2.6.9-xen-sparse/arch/xen/Makefile
linux-2.6.9-xen-sparse/arch/xen/i386/kernel/entry.S
linux-2.6.9-xen-sparse/arch/xen/i386/kernel/head.S
linux-2.6.9-xen-sparse/arch/xen/i386/kernel/ioport.c
linux-2.6.9-xen-sparse/arch/xen/i386/kernel/process.c
linux-2.6.9-xen-sparse/arch/xen/i386/pci/direct.c
linux-2.6.9-xen-sparse/arch/xen/i386/pci/irq.c
linux-2.6.9-xen-sparse/arch/xen/kernel/evtchn.c
linux-2.6.9-xen-sparse/arch/xen/kernel/reboot.c
linux-2.6.9-xen-sparse/drivers/xen/blkback/common.h
linux-2.6.9-xen-sparse/drivers/xen/blkfront/block.h
linux-2.6.9-xen-sparse/drivers/xen/console/console.c
linux-2.6.9-xen-sparse/drivers/xen/netback/common.h
linux-2.6.9-xen-sparse/drivers/xen/netfront/netfront.c
linux-2.6.9-xen-sparse/drivers/xen/privcmd/privcmd.c
linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/page.h
linux-2.6.9-xen-sparse/include/asm-xen/evtchn.h
linux-2.6.9-xen-sparse/include/asm-xen/gnttab.h
linux-2.6.9-xen-sparse/include/asm-xen/hypervisor.h
linux-2.6.9-xen-sparse/mkbuildtree
netbsd-2.0-xen-sparse/mkbuildtree
netbsd-2.0-xen-sparse/sys/arch/xen/include/hypervisor.h
netbsd-2.0-xen-sparse/sys/arch/xen/include/xen.h
netbsd-2.0-xen-sparse/sys/arch/xen/xen/xenkbc.c
tools/Make.defs
tools/libxc/xc.h
tools/python/setup.py
tools/python/xen/lowlevel/xu/xu.c
xen/COPYING
xen/Makefile
xen/Rules.mk
xen/arch/x86/boot/x86_32.S
xen/arch/x86/boot/x86_64.S
xen/arch/x86/dom0_ops.c
xen/arch/x86/trampoline.S
xen/arch/x86/x86_32/entry.S
xen/common/debug-linux.c
xen/common/debug.c
xen/common/dom0_ops.c
xen/common/domain.c
xen/common/event_channel.c
xen/common/kernel.c
xen/common/physdev.c
xen/common/sched_atropos.c
xen/common/sched_rrobin.c
xen/common/schedule.c
xen/common/trace.c
xen/include/asm-x86/mm.h
xen/include/asm-x86/pdb.h
xen/include/asm-x86/processor.h
xen/include/hypervisor-ifs/COPYING [deleted file]
xen/include/hypervisor-ifs/arch-x86_32.h [deleted file]
xen/include/hypervisor-ifs/arch-x86_64.h [deleted file]
xen/include/hypervisor-ifs/dom0_ops.h [deleted file]
xen/include/hypervisor-ifs/event_channel.h [deleted file]
xen/include/hypervisor-ifs/grant_table.h [deleted file]
xen/include/hypervisor-ifs/hypervisor-if.h [deleted file]
xen/include/hypervisor-ifs/io/blkif.h [deleted file]
xen/include/hypervisor-ifs/io/domain_controller.h [deleted file]
xen/include/hypervisor-ifs/io/netif.h [deleted file]
xen/include/hypervisor-ifs/physdev.h [deleted file]
xen/include/hypervisor-ifs/sched_ctl.h [deleted file]
xen/include/hypervisor-ifs/trace.h [deleted file]
xen/include/public/COPYING [new file with mode: 0644]
xen/include/public/arch-x86_32.h [new file with mode: 0644]
xen/include/public/arch-x86_64.h [new file with mode: 0644]
xen/include/public/dom0_ops.h [new file with mode: 0644]
xen/include/public/event_channel.h [new file with mode: 0644]
xen/include/public/grant_table.h [new file with mode: 0644]
xen/include/public/io/blkif.h [new file with mode: 0644]
xen/include/public/io/domain_controller.h [new file with mode: 0644]
xen/include/public/io/netif.h [new file with mode: 0644]
xen/include/public/physdev.h [new file with mode: 0644]
xen/include/public/sched_ctl.h [new file with mode: 0644]
xen/include/public/trace.h [new file with mode: 0644]
xen/include/public/xen.h [new file with mode: 0644]
xen/include/xen/grant_table.h
xen/include/xen/sched.h
xen/include/xen/time.h
xen/include/xen/trace.h

index c56e81efa9242654f3676ef63156502d51290e04..0859aeaab8bcd31f012ffec546586e6736df340f 100644 (file)
--- a/.rootkeys
+++ b/.rootkeys
 404f1bb86rAXB3aLS1vYdcqpJiEcyg xen/include/asm-x86/x86_64/ptrace.h
 40e1966azOJZfNI6Ilthe6Q-T3Hewg xen/include/asm-x86/x86_64/string.h
 404f1bc4tWkB9Qr8RkKtZGW5eMQzhw xen/include/asm-x86/x86_64/uaccess.h
-400304fcmRQmDdFYEzDh0wcBba9alg xen/include/hypervisor-ifs/COPYING
-404f1bc68SXxmv0zQpXBWGrCzSyp8w xen/include/hypervisor-ifs/arch-x86_32.h
-404f1bc7IwU-qnH8mJeVu0YsNGMrcw xen/include/hypervisor-ifs/arch-x86_64.h
-3ddb79c2PMeWTK86y4C3F4MzHw4A1g xen/include/hypervisor-ifs/dom0_ops.h
-403cd194j2pyLqXD8FJ-ukvZzkPenw xen/include/hypervisor-ifs/event_channel.h
-4121d149udGfSUGhn3k1ECz0bM31nQ xen/include/hypervisor-ifs/grant_table.h
-3ddb79c25UE59iu4JJcbRalx95mvcg xen/include/hypervisor-ifs/hypervisor-if.h
-40f5623bqoi4GEoBiiUc6TZk1HjsMg xen/include/hypervisor-ifs/io/blkif.h
-40dc4076pVeE1kEEWzcUaNZin65kCA xen/include/hypervisor-ifs/io/domain_controller.h
-40f5623cTZ80EwjWUBlh44A9F9i_Lg xen/include/hypervisor-ifs/io/netif.h
-4051db79512nOCGweabrFWO2M2h5ng xen/include/hypervisor-ifs/physdev.h
-40589968wmhPmV5-ENbBYmMjnedgKw xen/include/hypervisor-ifs/sched_ctl.h
-404f3d2eR2Owk-ZcGOx9ULGHg3nrww xen/include/hypervisor-ifs/trace.h
+400304fcmRQmDdFYEzDh0wcBba9alg xen/include/public/COPYING
+404f1bc68SXxmv0zQpXBWGrCzSyp8w xen/include/public/arch-x86_32.h
+404f1bc7IwU-qnH8mJeVu0YsNGMrcw xen/include/public/arch-x86_64.h
+3ddb79c2PMeWTK86y4C3F4MzHw4A1g xen/include/public/dom0_ops.h
+403cd194j2pyLqXD8FJ-ukvZzkPenw xen/include/public/event_channel.h
+4121d149udGfSUGhn3k1ECz0bM31nQ xen/include/public/grant_table.h
+40f5623bqoi4GEoBiiUc6TZk1HjsMg xen/include/public/io/blkif.h
+40dc4076pVeE1kEEWzcUaNZin65kCA xen/include/public/io/domain_controller.h
+40f5623cTZ80EwjWUBlh44A9F9i_Lg xen/include/public/io/netif.h
+4051db79512nOCGweabrFWO2M2h5ng xen/include/public/physdev.h
+40589968wmhPmV5-ENbBYmMjnedgKw xen/include/public/sched_ctl.h
+404f3d2eR2Owk-ZcGOx9ULGHg3nrww xen/include/public/trace.h
+3ddb79c25UE59iu4JJcbRalx95mvcg xen/include/public/xen.h
 3e397e66m2tO3s-J8Jnr7Ws_tGoPTg xen/include/xen/ac_timer.h
 40715b2epYl2jBbxzz9CI2rgIca7Zg xen/include/xen/acpi.h
 3ddb79c0c0cX_DZE209-Bb-Rx1v-Aw xen/include/xen/cache.h
diff --git a/COPYING b/COPYING
index 9e4ba6a151c11abcce0f90f091d0a9363d0b8ede..32f39ab5f8d5746048d837e5ecc04fc34cf5527b 100644 (file)
--- a/COPYING
+++ b/COPYING
@@ -17,12 +17,11 @@ Xen guests, certain files in this repository are not subject to the
 GPL when distributed separately or included in software packages
 outside this repository. Instead we specify a much more relaxed
 BSD-style license. Affected files include the Xen interface headers
-(xen/include/hypervisor-ifs/COPYING), and various drivers, support
-functions and header files within the Linux sparse source trees. In
-all such cases, license terms are stated at the top of the file or in
-a COPYING file in the same directory. Note that _any_ file that is
-modified and then distributed within a Linux kernel is still subject
-to the GNU GPL!
+(xen/include/public/COPYING), and various drivers, support functions
+and header files within the Linux sparse source trees. In all such
+cases, license terms are stated at the top of the file or in a COPYING
+file in the same directory. Note that _any_ file that is modified and
+then distributed within a Linux kernel is still subject to the GNU GPL.
 
  -- Keir Fraser (on behalf of the Xen team)
 
index 8f6f7a498a44af12fb69bbb97c78f8906250a732..adf1d3738aa9d3eba0d8db6bba7695671fc89cce 100644 (file)
@@ -244,8 +244,8 @@ records.  Pointers may only advance, and may not pass one another.
 By adopting the convention that every request will receive a response,
 not all four pointers need be shared and flow control on the ring
 becomes very easy to manage.  Each domain manages its own
-consumer pointer, and the two producer pointers are visible to both (Xen/include/hypervisor-ifs/io/blkif.h):
-
+consumer pointer, and the two producer pointers are visible to both
+(xen/include/public/io/blkif.h):
 
 
 /* NB. Ring size must be small enough for sizeof(blkif_ring_t) <=PAGE_SIZE.*/
index d6ac3542b2ce0119d65ee9c3b39a5b0801d7a069..25a169eb6644224faa904a68b5e27332c1acbf88 100644 (file)
@@ -514,7 +514,7 @@ this scheduler.
 \subsubsection{sched\_id}
 
 This is an integer that uniquely identifies this scheduler.  There should be a
-macro corrsponding to this scheduler ID in {\tt <hypervisor-ifs/sched-if.h>}.
+macro corrsponding to this scheduler ID in {\tt <xen/sched-if.h>}.
 
 \subsubsection{init\_scheduler}
 
index d2d478ac40ca449ecfa192d4f850e3f662e20eac..606454b6bb5ed2655e63ebd34543713cc14e9d5e 100644 (file)
@@ -14,16 +14,16 @@ TARGET := mini-os
 LOBJS := lib/malloc.o lib/math.o lib/printf.o lib/string.o 
 OBJS  := entry.o kernel.o traps.o hypervisor.o mm.o events.o time.o ${LOBJS}
 
-HINTF := h/hypervisor-ifs/hypervisor-if.h
+HINTF := h/xen-public/xen.h
 HDRS  :=  h/os.h h/types.h h/hypervisor.h h/mm.h h/events.h h/time.h h/lib.h
 HDRS  += $(HINTF)
 
 default: $(TARGET)
 
-hypervisor-ifs:
-       ln -sf ../../../xen/include/hypervisor-ifs h/hypervisor-ifs
+xen-public:
+       [ -e h/xen-public] || ln -sf ../../../xen/include/public h/xen-public
 
-$(TARGET): hypervisor-ifs head.o $(OBJS)
+$(TARGET): xen-public head.o $(OBJS)
        $(LD) -N -T minios.lds head.o $(OBJS) -o $@.elf
        objcopy -R .note -R .comment $@.elf $@
        gzip -f -9 -c $@ >$@.gz
index 5166876b76a3c79070f90ab684cb463053eb1423..c8f696ae90631be5143881890dfe83bd9b992696 100644 (file)
@@ -20,7 +20,7 @@
 #ifndef _EVENTS_H_
 #define _EVENTS_H_
 
-/* _EVENT_* are defined in hypervisor-if.h  */
+/* _EVENT_* are defined in xen-public/xen.h  */
 #define EV_BLKDEV _EVENT_BLKDEV
 #define EV_TIMER  _EVENT_TIMER
 #define EV_DIE    _EVENT_DIE
index c29bd1723e3c67658639788b5e1da9bd974908fd..3a127e1290f9fa50359940a9cac988be67b5e419 100644 (file)
@@ -11,9 +11,8 @@
 
 #include <types.h>
 
-/* include the hypervisor interface */
-#include <hypervisor-ifs/hypervisor-if.h>
-#include "../../../tools/xu/lib/domain_controller.h"
+#include <xen-public/xen.h>
+#include <xen-public/io/domain_controller.h>
 
 /*
  * a placeholder for the start of day information passed up from the hypervisor
index c717b6696149cf905c06499371beab6629093c44..cf15d9212629a89b8e2ba8c9c86b3160122ebbd3 100644 (file)
@@ -29,7 +29,7 @@
 
 
 /*
- * these are also defined in hypervisor-if.h but can't be pulled in as
+ * these are also defined in xen-public/xen.h but can't be pulled in as
  * they are used in start of day assembly. Need to clean up the .h files
  * a bit more...
  */
@@ -48,7 +48,7 @@
 #ifndef __ASSEMBLY__
 
 #include <types.h>
-#include <hypervisor-ifs/hypervisor-if.h>
+#include <xen-public/xen.h>
 
 
 /* this struct defines the way the registers are stored on the 
index f8f1e96214a6438530aa6f7b5a88be150b3f349a..1db1b7f1b6ed4dc285d6f9c0708b5b4104b7096c 100644 (file)
@@ -127,7 +127,7 @@ archclean:
        @$(MAKEBOOT) clean
 
 archmrproper:
-       rm -f include/asm-xen/hypervisor-ifs/arch
+       rm -f include/asm-xen/xen-public/arch
 
 archdep:
        @$(MAKEBOOT) dep
index 03937e0e4cf017b20f343718614368531d002600..d16895d2c26c20be606ce2c1b04f27d45f1dbe5e 100644 (file)
 #include <linux/hdreg.h>
 #include <linux/blkdev.h>
 #include <linux/major.h>
-#include <asm/hypervisor-ifs/hypervisor-if.h>
+#include <asm/xen-public/xen.h>
 #include <asm/io.h>
 #include <asm/atomic.h>
 #include <asm/uaccess.h>
-#include <asm-xen/hypervisor-ifs/io/blkif.h>
+#include <asm/xen-public/io/blkif.h>
 
 #if 0
 #define DPRINTK(_f, _a...) printk ( KERN_ALERT _f , ## _a )
index 48dcecd6ec3d74daafcf7836eb3e37771176182f..b77703ac89a131cecc62ba55015e3a4651830a84 100644 (file)
@@ -18,8 +18,8 @@
 #include <asm/segment.h>
 #include <asm/io.h>
 
-#include <asm/hypervisor-ifs/hypervisor-if.h>
-#include <asm/hypervisor-ifs/physdev.h>
+#include <asm/xen-public/xen.h>
+#include <asm/xen-public/physdev.h>
 
 #include "pci-i386.h"
 
index 9c1123b7403cba6e0cd6d568ae614292708d57b2..806e9a73f611e133e180501639d1c347591d2dec 100644 (file)
@@ -44,7 +44,7 @@
 #include <asm/desc.h>
 #include <asm/mmu_context.h>
 #include <asm/multicall.h>
-#include <asm/hypervisor-ifs/dom0_ops.h>
+#include <asm/xen-public/dom0_ops.h>
 
 #include <linux/irq.h>
 
index 61c2f73a075c572e3df4bcece72c5b5fe0cdb456..92312734b8d6f0b60c465d700d6a40be4745d064 100644 (file)
@@ -48,7 +48,7 @@ static int errno;
 #include <asm/mmu_context.h>
 #include <asm/ctrl_if.h>
 #include <asm/hypervisor.h>
-#include <asm/hypervisor-ifs/dom0_ops.h>
+#include <asm/xen-public/dom0_ops.h>
 #include <linux/netdevice.h>
 #include <linux/rtnetlink.h>
 #include <linux/tqueue.h>
@@ -335,7 +335,7 @@ void __init setup_arch(char **cmdline_p)
      * and the bootmem bitmap. 
      * NB. There is definitely enough room for the bootmem bitmap in the
      * bootstrap page table. We are guaranteed to get >=512kB unused 'padding'
-     * for our own use after all bootstrap elements (see hypervisor-if.h).
+     * for our own use after all bootstrap elements (see asm/xen-public/xen.h).
      */
     boot_pfn = min((int)xen_start_info.nr_pages,lmax_low_pfn);
     bootmap_size = init_bootmem(start_pfn,boot_pfn);
index 3a4f8bf2c53d4acd243d59ce4935add0d8e5b555..d4b6f5edac7077c3ad286916236746723be18cc9 100644 (file)
@@ -52,7 +52,7 @@
 
 #include <asm/div64.h>
 #include <asm/hypervisor.h>
-#include <asm/hypervisor-ifs/dom0_ops.h>
+#include <asm/xen-public/dom0_ops.h>
 
 #include <linux/mc146818rtc.h>
 #include <linux/kernel.h>
index 26e504485bf0593f8ff7ae09680ec077debbfaa5..239daa6ede73b8e3635edd5603f76e19a759dba4 100644 (file)
@@ -12,7 +12,7 @@
 #include <linux/config.h>
 #include <linux/string.h>
 #include <asm/types.h>
-#include <asm/hypervisor-ifs/hypervisor-if.h>
+#include <asm/xen-public/xen.h>
 
 #ifdef CONFIG_XEN_SCRUB_PAGES
 #define scrub_pages(_p,_n) memset((void *)(_p), 0, (_n) << PAGE_SHIFT)
index ca13028ce01f9090453f17f263d38366a9d5467c..276765d1de76799c8c7970918fa847499ff5a793 100644 (file)
@@ -4,7 +4,7 @@
 #ifndef __ASSEMBLY__
 #include <linux/types.h>
 #endif
-#include <asm/hypervisor-ifs/hypervisor-if.h>
+#include <asm/xen-public/xen.h>
 
 #define __KERNEL_CS    FLAT_RING1_CS
 #define __KERNEL_DS    FLAT_RING1_DS
index 3180d21675cdafac892cfa34f1a3c72e1e36468c..ff5e789ccfaa495226161280b1b537c336530836 100755 (executable)
@@ -107,11 +107,11 @@ set ${RS}/../linux-2.6.*-xen-sparse
 LINUX_26="$1"
 
 
-# Create links to the shared definitions of the hypervisor interface
-rm -rf ${AD}/include/asm-xen/hypervisor-ifs
-mkdir  ${AD}/include/asm-xen/hypervisor-ifs
-cd     ${AD}/include/asm-xen/hypervisor-ifs
-relative_lndir ../../../${RS}/../xen/include/hypervisor-ifs
+# Create links to the shared definitions of the Xen interfaces.
+rm -rf ${AD}/include/asm-xen/xen-public
+mkdir  ${AD}/include/asm-xen/xen-public
+cd     ${AD}/include/asm-xen/xen-public
+relative_lndir ../../../${RS}/../xen/include/public
 
 # Create a link to the shared definitions for the control interface
 cd ${AD}/include/asm-xen
index 224e0aa34f28069523b71a5d36f22228b4e24354..bda9cb8665dae997c9d3648a03c853a4bcdaaa95 100644 (file)
@@ -33,16 +33,16 @@ include/asm-xen/asm:
        @echo '  SYMLINK $@ -> include/asm-xen/asm-$(XENARCH)'
        @ln -fsn asm-$(XENARCH) $@
 
-include/asm-xen/asm-$(XENARCH)/hypervisor-ifs:
-       @echo '  SYMLINK $@ -> include/asm-xen/hypervisor-ifs'
-       @ln -fsn ../hypervisor-ifs $@
+include/asm-xen/asm-$(XENARCH)/xen-public:
+       @echo '  SYMLINK $@ -> include/asm-xen/xen-public'
+       @ln -fsn ../xen-public $@
 
 arch/xen/arch:
        @rm -f $@
        @ln -fsn $(XENARCH) $@
 
 prepare: include/.asm-ignore include/asm-xen/asm \
-       include/asm-xen/asm-$(XENARCH)/hypervisor-ifs \
+       include/asm-xen/asm-$(XENARCH)/xen-public \
        arch/xen/arch ;
 
 all: vmlinuz
index f1e60cc06c5c4098cff5ef17abe08e3cacdaba04..e6978360e880cf1f00f378c89268d65501009e7f 100644 (file)
@@ -48,7 +48,7 @@
 #include <asm/smp.h>
 #include <asm/page.h>
 #include "irq_vectors.h"
-#include <asm/hypervisor-ifs/hypervisor-if.h>
+#include <asm/xen-public/xen.h>
 
 #define nr_syscalls ((syscall_table_size)/4)
 
index b41a96db42e9ca2f324a64fbdee0d04c01148017..b773a18e5e13d902e25472fd648511959bcfaa04 100644 (file)
@@ -15,7 +15,7 @@
 #include <asm/segment.h>
 #include <asm/thread_info.h>
 #include <asm/asm_offsets.h>
-#include <asm/hypervisor-ifs/arch-x86_32.h>
+#include <asm/xen-public/arch-x86_32.h>
 
 /*
  * References to members of the new_cpu_data structure.
index bb3b0f3090b9f1ec2d9015b7bdba5f484903b36f..3c85bee294511f2765b644830f89c48d9f4edf12 100644 (file)
@@ -8,7 +8,7 @@
 #include <linux/smp_lock.h>
 #include <linux/stddef.h>
 #include <linux/slab.h>
-#include <asm/hypervisor-ifs/dom0_ops.h>
+#include <asm/xen-public/dom0_ops.h>
 
 asmlinkage long sys_iopl(unsigned int new_io_pl)
 {
index 930e9151a32973871c85872849d28587e3e6a969..66d9d6e4d0e8e2cf13cd31923ad5a02e83942c37 100644 (file)
@@ -47,7 +47,7 @@
 #include <asm/irq.h>
 #include <asm/desc.h>
 #include <asm-xen/multicall.h>
-#include <asm/hypervisor-ifs/dom0_ops.h>
+#include <asm/xen-public/dom0_ops.h>
 #ifdef CONFIG_MATH_EMULATION
 #include <asm/math_emu.h>
 #endif
index 661221379bcca67e0a75704c1092de89aa75f6ec..e964ae00f1d87211344888911811d851f52950a4 100644 (file)
@@ -6,8 +6,8 @@
 #include <linux/init.h>
 #include "pci.h"
 
-#include <asm/hypervisor-ifs/hypervisor-if.h>
-#include <asm/hypervisor-ifs/physdev.h>
+#include <asm/xen-public/xen.h>
+#include <asm/xen-public/physdev.h>
 
 /*
  * Functions for accessing PCI configuration space with type xen accesses
index 7dc8dfb0bac3527e3ca480417fbccc5b04d44bbd..b7761350a9a9e918ee7058225779c515902eb6b1 100644 (file)
@@ -19,8 +19,8 @@
 
 #include "pci.h"
 
-#include <asm/hypervisor-ifs/hypervisor-if.h>
-#include <asm/hypervisor-ifs/physdev.h>
+#include <asm/xen-public/xen.h>
+#include <asm/xen-public/physdev.h>
 
 /*
  * Never use: 0, 1, 2 (timer, keyboard, and cascade)
index b779ac114ca99a12c27b5079a180ca8c31f8a6a5..37ba61846af9d045a3ce81bc3d28972f193819fe 100644 (file)
@@ -38,8 +38,8 @@
 #include <asm/system.h>
 #include <asm/ptrace.h>
 #include <asm/synch_bitops.h>
-#include <asm/hypervisor-ifs/event_channel.h>
-#include <asm/hypervisor-ifs/physdev.h>
+#include <asm/xen-public/event_channel.h>
+#include <asm/xen-public/physdev.h>
 #include <asm-xen/ctrl_if.h>
 #include <asm-xen/hypervisor.h>
 
index 9b9761e8417f650abfd7ed9a4469e54fbae429ba..2e8192962486257b6193935e0883e673fe841a18 100644 (file)
@@ -12,7 +12,7 @@ static int errno;
 #include <asm/mmu_context.h>
 #include <asm-xen/ctrl_if.h>
 #include <asm-xen/hypervisor.h>
-#include <asm-xen/hypervisor-ifs/dom0_ops.h>
+#include <asm-xen/xen-public/dom0_ops.h>
 #include <asm-xen/suspend.h>
 #include <asm-xen/queues.h>
 
index 0fa60cdceb827cc31fd0af710d2ff6a5fb0594e1..4a12ca8fe9644184aa5d3368c1462ec29244d3f0 100644 (file)
@@ -14,7 +14,7 @@
 #include <asm/pgalloc.h>
 #include <asm-xen/ctrl_if.h>
 #include <asm-xen/hypervisor.h>
-#include <asm-xen/hypervisor-ifs/io/blkif.h>
+#include <asm-xen/xen-public/io/blkif.h>
 
 #if 0
 #define ASSERT(_p) \
index 76255e863719fa973118246e9a58a535e7ac1662..8503cfedcc3aae2a9f67a8ca7fbc80a9d8140864 100644 (file)
@@ -44,8 +44,8 @@
 #include <linux/blkdev.h>
 #include <linux/major.h>
 #include <linux/devfs_fs_kernel.h>
-#include <asm/hypervisor-ifs/hypervisor-if.h>
-#include <asm-xen/hypervisor-ifs/io/blkif.h>
+#include <asm/xen-public/xen.h>
+#include <asm-xen/xen-public/io/blkif.h>
 #include <asm/io.h>
 #include <asm/atomic.h>
 #include <asm/uaccess.h>
index 8309c253d058a0f3725a8f5b1539a3a8d3f1477e..f2da97e1f409d389cd1719764e7cf738aee8f924 100644 (file)
@@ -47,7 +47,7 @@
 #include <asm/io.h>
 #include <asm/irq.h>
 #include <asm/uaccess.h>
-#include <asm/hypervisor-ifs/event_channel.h>
+#include <asm/xen-public/event_channel.h>
 #include <asm-xen/hypervisor.h>
 #include <asm-xen/evtchn.h>
 #include <asm-xen/ctrl_if.h>
index 6646f5339f17b513c89c0e0f82b5fa49e16861a9..a8eeac8aacded9ee77e7576dba58ce259149c4ab 100644 (file)
@@ -15,7 +15,7 @@
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
 #include <asm-xen/ctrl_if.h>
-#include <asm-xen/hypervisor-ifs/io/netif.h>
+#include <asm-xen/xen-public/io/netif.h>
 #include <asm/io.h>
 #include <asm/pgalloc.h>
 
index 831572b4b20236af8ed0bf8a17f566e5a5e0107f..6f702fa8f8b021ecf3fff03a4036a01ebe21e678 100644 (file)
@@ -44,7 +44,7 @@
 #include <asm/io.h>
 #include <asm-xen/evtchn.h>
 #include <asm-xen/ctrl_if.h>
-#include <asm-xen/hypervisor-ifs/io/netif.h>
+#include <asm-xen/xen-public/io/netif.h>
 #include <asm/page.h>
 
 #include <net/arp.h>
index 42c5b1309c75d1c6b40d01efb837cd99a5255b1f..62994ba30248b7b8af17be8fabde3309cfe7c636 100644 (file)
@@ -26,7 +26,7 @@
 #include <asm/uaccess.h>
 #include <asm/tlb.h>
 #include <asm-xen/proc_cmd.h>
-#include <asm/hypervisor-ifs/dom0_ops.h>
+#include <asm/xen-public/dom0_ops.h>
 #include <asm-xen/xen_proc.h>
 
 static struct proc_dir_entry *privcmd_intf;
index 34e8f7f9eb6df345a0b4201d6cf2649a23849037..e2604817b62edefa9400e71fc1447b5411b8dacb 100644 (file)
@@ -15,7 +15,7 @@
 #include <linux/config.h>
 #include <linux/string.h>
 #include <linux/types.h>
-#include <asm/hypervisor-ifs/hypervisor-if.h>
+#include <asm/xen-public/xen.h>
 
 #ifdef CONFIG_XEN_SCRUB_PAGES
 #define scrub_pages(_p,_n) memset((void *)(_p), 0, (_n) << PAGE_SHIFT)
index 2ad902ed6ba41c6537918cd6179a547905b9735b..ace8984b087cde496aa6dce24bb541592045f8a6 100644 (file)
@@ -35,7 +35,7 @@
 #include <asm-xen/hypervisor.h>
 #include <asm/ptrace.h>
 #include <asm/synch_bitops.h>
-#include <asm/hypervisor-ifs/event_channel.h>
+#include <asm/xen-public/event_channel.h>
 
 /*
  * LOW-LEVEL DEFINITIONS
index 6e52923b17df5bac131cdb3d3a50b7ba114ef721..fa166ec6b17d5f04e72dea394df37c59a114fea9 100644 (file)
@@ -14,7 +14,7 @@
 
 #include <linux/config.h>
 #include <asm-xen/hypervisor.h>
-#include <asm-xen/hypervisor-ifs/grant_table.h>
+#include <asm-xen/xen-public/grant_table.h>
 
 int
 gnttab_grant_foreign_access(
index 3054b30779ba5cc806c4349a78fd796876902b68..f3536bf38df44777f495b20530b39aa7fbc23116 100644 (file)
@@ -33,9 +33,9 @@
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/version.h>
-#include <asm/hypervisor-ifs/hypervisor-if.h>
-#include <asm/hypervisor-ifs/dom0_ops.h>
-#include <asm/hypervisor-ifs/io/domain_controller.h>
+#include <asm/xen-public/xen.h>
+#include <asm/xen-public/dom0_ops.h>
+#include <asm/xen-public/io/domain_controller.h>
 #include <asm/ptrace.h>
 #include <asm/page.h>
 
index 20513e6ead44a6049c6ff53d610ace1c1e544bc7..d353015ff20d007bab702aa4017ccf39efdbfd4e 100755 (executable)
@@ -103,9 +103,9 @@ relative_lndir ${RS}
 rm -f mkbuildtree
 
 
-# Create links to the shared definitions of the hypervisor interface
-rm -rf ${AD}/include/asm-xen/hypervisor-ifs
-mkdir  ${AD}/include/asm-xen/hypervisor-ifs
-cd     ${AD}/include/asm-xen/hypervisor-ifs
-relative_lndir ../../../${RS}/../xen/include/hypervisor-ifs
+# Create links to the shared definitions of the Xen interfaces.
+rm -rf ${AD}/include/asm-xen/xen-public
+mkdir  ${AD}/include/asm-xen/xen-public
+cd     ${AD}/include/asm-xen/xen-public
+relative_lndir ../../../${RS}/../xen/include/public
 
index 2db906080a8f98a426e8d4785487fd91ace463f1..1877db8a5ea088c8626d83c371fdc59847231974 100755 (executable)
@@ -103,11 +103,11 @@ relative_lndir ${RS}
 rm -f mkbuildtree
 
 
-# Create links to the shared definitions of the hypervisor interface
-rm -rf ${AD}/sys/arch/xen/include/hypervisor-ifs
-mkdir  ${AD}/sys/arch/xen/include/hypervisor-ifs
-cd     ${AD}/sys/arch/xen/include/hypervisor-ifs
-relative_lndir ../../../../../${RS}/../xen/include/hypervisor-ifs
+# Create links to the shared definitions of the Xen interface
+rm -rf ${AD}/sys/arch/xen/include/xen-public
+mkdir  ${AD}/sys/arch/xen/include/xen-public
+cd     ${AD}/sys/arch/xen/include/xen-public
+relative_lndir ../../../../../${RS}/../xen/include/public
 
 # Remove files which don't exist anymore
 rm -rf ${AD}/sys/arch/xen/xen/events.c
index 3d3f1d38c73c5bcaf4fa2db3e5c8ce5a96b4fe9a..035495d4be4a406c0d9b58a71fa91bd7d916d1b0 100644 (file)
@@ -54,12 +54,12 @@ struct xen_npx_attach_args {
 
 /* include the hypervisor interface */
 #include <sys/systm.h>
-#include <machine/hypervisor-ifs/hypervisor-if.h>
-#include <machine/hypervisor-ifs/dom0_ops.h>
-#include <machine/hypervisor-ifs/event_channel.h>
-#include <machine/hypervisor-ifs/io/domain_controller.h>
-#include <machine/hypervisor-ifs/io/netif.h>
-#include <machine/hypervisor-ifs/io/blkif.h>
+#include <machine/xen-public/xen.h>
+#include <machine/xen-public/dom0_ops.h>
+#include <machine/xen-public/event_channel.h>
+#include <machine/xen-public/io/domain_controller.h>
+#include <machine/xen-public/io/netif.h>
+#include <machine/xen-public/io/blkif.h>
 
 #undef u8
 #undef u16
index 274dad8410aef3f9180f2343d18e2d8268f177a7..e590db5ae6ccef079e299860d293a0c9d0cbd240 100644 (file)
@@ -85,7 +85,7 @@ void vprintk(const char *, va_list);
 
 
 /*
- * these are also defined in hypervisor-if.h but can't be pulled in as
+ * these are also defined in xen-public/xen.h but can't be pulled in as
  * they are used in start of day assembly. Need to clean up the .h files
  * a bit more...
  */
index e54615567bf65496d6587b1d856a4150b8089051..ede2207965b663efdbbc54d96d4005a8ed0cd256 100644 (file)
@@ -74,7 +74,7 @@ __KERNEL_RCSID(0, "$NetBSD: xenkbc.c,v 1.3.2.1 2004/05/22 15:57:43 he Exp $");
 #include <machine/xenkbcvar.h>
 #include <machine/xen.h>
 #include <machine/hypervisor.h>
-#include <machine/hypervisor-ifs/kbd.h>
+#include <machine/xen-public/kbd.h>
 #include <machine/evtchn.h>
 
 #define        KBC_DELAY       DELAY(1000)
index 1b4d4fec7f9446165403ba5f5edb43075c817eb0..7f40cfef6a40423360da620668ccb6dae9efd989 100644 (file)
@@ -1,5 +1,5 @@
 #  -*- mode: Makefile; -*-
-XEN_HYPERVISOR_IFS = $(XEN_ROOT)/xen/include/hypervisor-ifs
+XEN_HYPERVISOR_IFS = $(XEN_ROOT)/xen/include/public
 XEN_LINUX_INCLUDE  = $(XEN_ROOT)/linux-xen-sparse/include
 XEN_XC             = $(XEN_ROOT)/tools/python/xen/lowlevel/xc
 XEN_LIBXC          = $(XEN_ROOT)/tools/libxc
index 4f01a8d9b45d0a3d08abffc49d59b6f0537447df..ab3ace4ff1d21ef0eaf487e939aa2fd65022fee5 100644 (file)
@@ -18,7 +18,7 @@ typedef signed short       s16;
 typedef signed long        s32;
 typedef signed long long   s64;
 
-#include "xen/hypervisor-if.h"
+#include "xen/xen.h"
 #include "xen/dom0_ops.h"
 #include "xen/event_channel.h"
 #include "xen/sched_ctl.h"
index 7adae6cc94e90937e55efb88e11481a0e5c7afea..ec7efc0b63ae9eb1c6995245293c344ead295e3d 100644 (file)
@@ -7,8 +7,7 @@ XEN_ROOT = "../.."
 extra_compile_args  = [ "-fno-strict-aliasing", "-Wall", "-Werror" ]
 
 
-include_dirs = [ XEN_ROOT + "/xen/include/hypervisor-ifs",
-                 XEN_ROOT + "/linux-xen-sparse/include",
+include_dirs = [ XEN_ROOT + "/linux-xen-sparse/include",
                  XEN_ROOT + "/tools/python/xen/lowlevel/xu",
                  XEN_ROOT + "/tools/libxc",
                  XEN_ROOT + "/tools/libxutil",
index d08a17aa111db09068adfed8cded1aed0fddc5ad..51437005385655ef10d680f58aa0efe306ceea55 100644 (file)
@@ -23,8 +23,8 @@
 #include <signal.h>
 #include <xc.h>
 
-#include <hypervisor-if.h>
-#include <io/domain_controller.h>
+#include <xen/xen.h>
+#include <xen/io/domain_controller.h>
 
 #include <asm-xen/proc_cmd.h>
 
index 8da935f55e9ad31c798b36770e6088bf48f70609..fb8fcc90fccb7caddff2b8e6ec9919df44bc3cf2 100644 (file)
@@ -10,9 +10,9 @@ virtual machine monitor) is copyrighted by me and others who actually
 wrote it.
 
 Further note that the guest-OS interfacing header files, which
-includes all files within the subdirectory include/hypervisor-ifs, are
+includes all files within the subdirectory include/public, are
 *not* covered by the GPL but by a much weaker license:
- include/hypervisor-ifs/COPYING
+ include/public/COPYING
 
 Also note that the only valid version of the GPL as far as Xen is
 concerned is _this_ particular version of the license (i.e., *only*
index ae43aa188c61c373af3f5b3313cd87d622306092..e47e2ea8a64092fc7edae73630e3c4bdf7138024 100644 (file)
@@ -23,9 +23,9 @@ install: $(TARGET)
        install -m0644 $(TARGET).gz $(prefix)/boot
        install -m0644 $(TARGET)-syms $(prefix)/boot
        mkdir -p $(prefix)/usr/include/xen/io
-       install -m0644 include/hypervisor-ifs/*.h $(prefix)/usr/include/xen
-       install -m0644 include/hypervisor-ifs/io/*.h $(prefix)/usr/include/xen/io
-       install -m0644 include/hypervisor-ifs/COPYING $(prefix)/usr/include/xen
+       install -m0644 include/public/*.h $(prefix)/usr/include/xen
+       install -m0644 include/public/io/*.h $(prefix)/usr/include/xen/io
+       install -m0644 include/public/COPYING $(prefix)/usr/include/xen
 
 dist: $(TARGET)
        $(MAKE) prefix=`pwd`/../install dist=yes install
index 12fde1e8e4fcffdba06ba3d30e3647762f76b9d9..ecb20cb35a08c260ba8390f1caf1b0210537020a 100644 (file)
@@ -18,7 +18,7 @@ TARGET_SUBARCH  ?= $(COMPILE_SUBARCH)
 TARGET  := $(BASEDIR)/xen
 HDRS    := $(wildcard $(BASEDIR)/include/xen/*.h)
 HDRS    += $(wildcard $(BASEDIR)/include/scsi/*.h)
-HDRS    += $(wildcard $(BASEDIR)/include/hypervisor-ifs/*.h)
+HDRS    += $(wildcard $(BASEDIR)/include/public/*.h)
 HDRS    += $(wildcard $(BASEDIR)/include/asm-$(TARGET_ARCH)/*.h)
 HDRS    += $(wildcard $(BASEDIR)/include/asm-$(TARGET_ARCH)/$(TARGET_SUBARCH)/*.h)
 # compile.h is always regenerated, but other files shouldn't be rebuilt
index ce09feb6e8184426bbbf1a031f068aff75ed6a04..305c279c5ea8fce29644f67989719032cb96a34d 100644 (file)
@@ -1,5 +1,5 @@
 #include <xen/config.h>
-#include <hypervisor-ifs/hypervisor-if.h>
+#include <public/xen.h>
 #include <asm/page.h>
 
 #define  SECONDARY_CPU_FLAG 0xA5A5A5A5
index 73a23023e29bbdde090ed6d72348b54e73b7f7ed..98289c7ab656e07bfddfa654f7630bddd773d345 100644 (file)
@@ -1,5 +1,5 @@
 #include <xen/config.h>
-#include <hypervisor-ifs/hypervisor-if.h>
+#include <public/xen.h>
 #include <asm/page.h>
 #include <asm/msr.h>
 
index ce677b1165640beb6b4eb739649993adba83830f..62b2739d18381b303716ffb120ad76bea226b383 100644 (file)
@@ -10,7 +10,7 @@
 #include <xen/types.h>
 #include <xen/lib.h>
 #include <xen/mm.h>
-#include <hypervisor-ifs/dom0_ops.h>
+#include <public/dom0_ops.h>
 #include <xen/sched.h>
 #include <xen/event.h>
 #include <asm/domain_page.h>
@@ -19,7 +19,7 @@
 #include <xen/trace.h>
 #include <xen/console.h>
 #include <asm/shadow.h>
-#include <hypervisor-ifs/sched_ctl.h>
+#include <public/sched_ctl.h>
 
 #define TRC_DOM0OP_ENTER_BASE  0x00020000
 #define TRC_DOM0OP_LEAVE_BASE  0x00030000
index d625a475580eea44614d4b5b15221116b1da4cbd..9c89ecf059b9e95fb2ce8ff5b238c609a5f938b1 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 #include <xen/config.h>
-#include <hypervisor-ifs/hypervisor-if.h>
+#include <public/xen.h>
 #include <asm/page.h>
 
 #ifdef CONFIG_SMP
index 460104244c2f84a0c9bf6d55d18b2458212f6f27..5dad5b0b26348b110305f66bc699aa672585afdd 100644 (file)
@@ -59,7 +59,7 @@
 #include <xen/config.h>
 #include <xen/errno.h>
 #include <xen/softirq.h>
-#include <hypervisor-ifs/hypervisor-if.h>
+#include <public/xen.h>
 
 EBX            = 0x00
 ECX            = 0x04
index 557997be3f5830e3d451e55c23e2e6bb552b84eb..03c4995eb19cebcb969f0e4eb95b31137dafa4ed 100644 (file)
@@ -13,7 +13,7 @@
 #include <xen/config.h>
 #include <xen/types.h>
 #include <xen/lib.h>
-#include <hypervisor-ifs/dom0_ops.h>
+#include <public/dom0_ops.h>
 #include <asm/pdb.h>
 
 /* from linux/sched.h */
index b17748a864b70f21fe52f12098e84573d558027c..fa99d6bd8fd427ab3fdccdc329ba8070e7d03413 100644 (file)
@@ -7,7 +7,7 @@
 #include <xen/config.h>
 #include <xen/types.h>
 #include <xen/lib.h>
-#include <hypervisor-ifs/dom0_ops.h>
+#include <public/dom0_ops.h>
 #include <xen/sched.h>
 #include <xen/event.h>
 #include <asm/page.h>
index f949c7d7af9730d19ce50c4e74775e7d27091cf7..aa979f1dc046538a87bb3b04478679a253aa48ea 100644 (file)
@@ -10,7 +10,7 @@
 #include <xen/types.h>
 #include <xen/lib.h>
 #include <xen/mm.h>
-#include <hypervisor-ifs/dom0_ops.h>
+#include <public/dom0_ops.h>
 #include <xen/sched.h>
 #include <xen/event.h>
 #include <asm/domain_page.h>
@@ -18,7 +18,7 @@
 #include <xen/trace.h>
 #include <xen/console.h>
 #include <asm/shadow.h>
-#include <hypervisor-ifs/sched_ctl.h>
+#include <public/sched_ctl.h>
 
 #define TRC_DOM0OP_ENTER_BASE  0x00020000
 #define TRC_DOM0OP_LEAVE_BASE  0x00030000
index cbbd29c0cb2bea482dbf326f7981cccfa00b2e8d..dff88d1fc0dec2bcf210628bd3beb4286e7cf477 100644 (file)
@@ -14,7 +14,7 @@
 #include <xen/time.h>
 #include <xen/console.h>
 #include <asm/shadow.h>
-#include <hypervisor-ifs/dom0_ops.h>
+#include <public/dom0_ops.h>
 #include <asm/domain_page.h>
 
 /* Both these structures are protected by the tasklist_lock. */
index ca2eb46f1220bd0ab462374d447ad2426d1f3100..40e218c731a3512d16da268f55484dd3e95727ab 100644 (file)
@@ -23,8 +23,8 @@
 #include <xen/event.h>
 #include <xen/irq.h>
 
-#include <hypervisor-ifs/hypervisor-if.h>
-#include <hypervisor-ifs/event_channel.h>
+#include <public/xen.h>
+#include <public/event_channel.h>
 
 #define INIT_EVENT_CHANNELS   16
 #define MAX_EVENT_CHANNELS  1024
index 79bb14324a9efc51b6f9d240445a103e3d6f2e8f..481b05de17908cc8f5694d51eaff26f883e61aca 100644 (file)
@@ -24,7 +24,7 @@
 #include <asm/io.h>
 #include <asm/uaccess.h>
 #include <asm/domain_page.h>
-#include <hypervisor-ifs/dom0_ops.h>
+#include <public/dom0_ops.h>
 
 unsigned long xenheap_phys_end;
 
index ff486ba29bbe39f231a38ad4a9afbdf37c906e02..b1c16d00b332741c3573ac8b62d2f0482af2a680 100644 (file)
@@ -26,8 +26,8 @@
 #include <xen/irq.h>
 #include <xen/event.h>
 #include <asm/pci.h>
-#include <hypervisor-ifs/hypervisor-if.h>
-#include <hypervisor-ifs/physdev.h>
+#include <public/xen.h>
+#include <public/physdev.h>
 
 /* Called by PHYSDEV_PCI_INITIALISE_DEVICE to finalise IRQ routing. */
 extern void pcibios_enable_irq(struct pci_dev *dev);
index b83d853d5d00916e4f8f1c74f51885f628fbfd94..1565b86ac9db6548a6de3f8753a3cacf21eeda7c 100644 (file)
@@ -20,7 +20,7 @@
 #include <xen/time.h>
 #include <xen/sched.h>
 #include <xen/sched-if.h>
-#include <hypervisor-ifs/sched_ctl.h>
+#include <public/sched_ctl.h>
 #include <xen/trace.h>
 
 #define ATROPOS_TASK_UNBLOCKED 16
index 1915b376325b3786cc5c367cc592097f2f8bb806..fbf17ab84cf4219228f80b7ad6ad1df6d1b984c1 100644 (file)
@@ -6,7 +6,7 @@
 
 #include <xen/sched.h>
 #include <xen/sched-if.h>
-#include <hypervisor-ifs/sched_ctl.h>
+#include <public/sched_ctl.h>
 #include <xen/ac_timer.h>
 #include <xen/softirq.h>
 #include <xen/time.h>
index 7b7530616c0bd565db39085ea4273d9111e7d4c4..138234104d591279fbf67afa6775f09d4b4ea066 100644 (file)
@@ -26,7 +26,7 @@
 #include <xen/sched-if.h>
 #include <xen/softirq.h>
 #include <xen/trace.h>
-#include <hypervisor-ifs/sched_ctl.h>
+#include <public/sched_ctl.h>
 
 /*#define WAKE_HISTO*/
 /*#define BLOCKTIME_HISTO*/
index 1e4e63462744a9ad0e62153d18f7d53bfb04d5f8..4b8d5b6f373c285610c807b3a73a7e79cc29ec14 100644 (file)
@@ -13,7 +13,7 @@
  * it's possible to reconstruct a chronological record of trace events.
  *
  * See also include/xen/trace.h and the dom0 op in
- * include/hypervisor-ifs/dom0_ops.h
+ * include/public/dom0_ops.h
  */
 
 #include <xen/config.h>
@@ -26,7 +26,7 @@
 #include <xen/trace.h>
 #include <xen/errno.h>
 #include <asm/atomic.h>
-#include <hypervisor-ifs/dom0_ops.h>
+#include <public/dom0_ops.h>
 
 /* Pointers to the meta-data objects for all system trace buffers */
 struct t_buf *t_bufs[NR_CPUS];
index 5068294ded3e8d38fb97df53acb86abbd2d84334..31a669c08d23c77f89aae816c705151bfe0aae88 100644 (file)
@@ -14,7 +14,7 @@
 #include <asm/flushtlb.h>
 #include <asm/io.h>
 
-#include <hypervisor-ifs/hypervisor-if.h>
+#include <public/xen.h>
 
 /*
  * Per-page-frame information.
index db98294b7ddbd42980424851ff7a01564fe45c7a..d718505089adb71c77a90fe3853fc4b7a6e36758 100644 (file)
@@ -14,8 +14,8 @@
 
 #include <asm/ptrace.h>
 #include <xen/list.h>
-#include <hypervisor-ifs/dom0_ops.h>
-#include <hypervisor-ifs/hypervisor-if.h>                   /* for domain id */
+#include <public/dom0_ops.h>
+#include <public/xen.h>                   /* for domain id */
 
 extern int pdb_initialized;
 extern int pdb_com_port;
index f6951c0bc10682ac9ddecb4157d9826c5b55f112..e87c0986a133add31da77e834f9fa2afade5604a 100644 (file)
@@ -15,7 +15,7 @@
 #include <asm/pdb.h>
 #include <xen/config.h>
 #include <xen/spinlock.h>
-#include <hypervisor-ifs/hypervisor-if.h>
+#include <public/xen.h>
 
 struct domain;
 
diff --git a/xen/include/hypervisor-ifs/COPYING b/xen/include/hypervisor-ifs/COPYING
deleted file mode 100644 (file)
index 3377710..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-XEN NOTICE
-==========
-
-This copyright applies to all files within this subdirectory. All
-other files in the Xen source distribution are covered by version 2 of
-the GNU General Public License.
-
- -- Keir Fraser (on behalf of the Xen team)
-
-=====================================================================
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to
-deal in the Software without restriction, including without limitation the
-rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-sell copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
-DEALINGS IN THE SOFTWARE.
diff --git a/xen/include/hypervisor-ifs/arch-x86_32.h b/xen/include/hypervisor-ifs/arch-x86_32.h
deleted file mode 100644 (file)
index 91a111b..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-/******************************************************************************
- * arch-i386/hypervisor-if.h
- * 
- * Guest OS interface to x86 32-bit Xen.
- */
-
-#ifndef __HYPERVISOR_IF_I386_H__
-#define __HYPERVISOR_IF_I386_H__
-
-/*
- * Pointers and other address fields inside interface structures are padded to
- * 64 bits. This means that field alignments aren't different between 32- and
- * 64-bit architectures. 
- */
-/* NB. Multi-level macro ensures __LINE__ is expanded before concatenation. */
-#define __MEMORY_PADDING(_X) u32 __pad_ ## _X
-#define _MEMORY_PADDING(_X)  __MEMORY_PADDING(_X)
-#define MEMORY_PADDING       _MEMORY_PADDING(__LINE__)
-
-/*
- * SEGMENT DESCRIPTOR TABLES
- */
-/*
- * A number of GDT entries are reserved by Xen. These are not situated at the
- * start of the GDT because some stupid OSes export hard-coded selector values
- * in their ABI. These hard-coded values are always near the start of the GDT,
- * so Xen places itself out of the way.
- * 
- * NB. The reserved range is inclusive (that is, both FIRST_RESERVED_GDT_ENTRY
- * and LAST_RESERVED_GDT_ENTRY are reserved).
- */
-#define NR_RESERVED_GDT_ENTRIES    40
-#define FIRST_RESERVED_GDT_ENTRY   256
-#define LAST_RESERVED_GDT_ENTRY    \
-  (FIRST_RESERVED_GDT_ENTRY + NR_RESERVED_GDT_ENTRIES - 1)
-
-
-/*
- * These flat segments are in the Xen-private section of every GDT. Since these
- * are also present in the initial GDT, many OSes will be able to avoid
- * installing their own GDT.
- */
-#define FLAT_RING1_CS 0x0819    /* GDT index 259 */
-#define FLAT_RING1_DS 0x0821    /* GDT index 260 */
-#define FLAT_RING3_CS 0x082b    /* GDT index 261 */
-#define FLAT_RING3_DS 0x0833    /* GDT index 262 */
-
-#define FLAT_GUESTOS_CS FLAT_RING1_CS
-#define FLAT_GUESTOS_DS FLAT_RING1_DS
-#define FLAT_USER_CS    FLAT_RING3_CS
-#define FLAT_USER_DS    FLAT_RING3_DS
-
-/* And the trap vector is... */
-#define TRAP_INSTR "int $0x82"
-
-
-/*
- * Virtual addresses beyond this are not modifiable by guest OSes. The 
- * machine->physical mapping table starts at this address, read-only.
- */
-#define HYPERVISOR_VIRT_START (0xFC000000UL)
-#ifndef machine_to_phys_mapping
-#define machine_to_phys_mapping ((unsigned long *)HYPERVISOR_VIRT_START)
-#endif
-
-#ifndef __ASSEMBLY__
-
-/* NB. Both the following are 32 bits each. */
-typedef unsigned long memory_t;   /* Full-sized pointer/address/memory-size. */
-typedef unsigned long cpureg_t;   /* Full-sized register.                    */
-
-/*
- * Send an array of these to HYPERVISOR_set_trap_table()
- */
-#define TI_GET_DPL(_ti)      ((_ti)->flags & 3)
-#define TI_GET_IF(_ti)       ((_ti)->flags & 4)
-#define TI_SET_DPL(_ti,_dpl) ((_ti)->flags |= (_dpl))
-#define TI_SET_IF(_ti,_if)   ((_ti)->flags |= ((!!(_if))<<2))
-typedef struct {
-    u8       vector;  /* 0: exception vector                              */
-    u8       flags;   /* 1: 0-3: privilege level; 4: clear event enable?  */
-    u16      cs;      /* 2: code selector                                 */
-    memory_t address; /* 4: code address                                  */
-} PACKED trap_info_t; /* 8 bytes */
-
-typedef struct
-{
-    unsigned long ebx;
-    unsigned long ecx;
-    unsigned long edx;
-    unsigned long esi;
-    unsigned long edi;
-    unsigned long ebp;
-    unsigned long eax;
-    unsigned long ds;
-    unsigned long es;
-    unsigned long fs;
-    unsigned long gs;
-    unsigned long _unused;
-    unsigned long eip;
-    unsigned long cs;
-    unsigned long eflags;
-    unsigned long esp;
-    unsigned long ss;
-} PACKED execution_context_t;
-
-typedef u64 tsc_timestamp_t; /* RDTSC timestamp */
-
-/*
- * The following is all CPU context. Note that the i387_ctxt block is filled 
- * in by FXSAVE if the CPU has feature FXSR; otherwise FSAVE is used.
- */
-typedef struct {
-#define ECF_I387_VALID (1<<0)
-    unsigned long flags;
-    execution_context_t cpu_ctxt;           /* User-level CPU registers     */
-    char          fpu_ctxt[256];            /* User-level FPU registers     */
-    trap_info_t   trap_ctxt[256];           /* Virtual IDT                  */
-    unsigned int  fast_trap_idx;            /* "Fast trap" vector offset    */
-    unsigned long ldt_base, ldt_ents;       /* LDT (linear address, # ents) */
-    unsigned long gdt_frames[16], gdt_ents; /* GDT (machine frames, # ents) */
-    unsigned long guestos_ss, guestos_esp;  /* Virtual TSS (only SS1/ESP1)  */
-    unsigned long pt_base;                  /* CR3 (pagetable base)         */
-    unsigned long debugreg[8];              /* DB0-DB7 (debug registers)    */
-    unsigned long event_callback_cs;        /* CS:EIP of event callback     */
-    unsigned long event_callback_eip;
-    unsigned long failsafe_callback_cs;     /* CS:EIP of failsafe callback  */
-    unsigned long failsafe_callback_eip;
-} PACKED full_execution_context_t;
-
-typedef struct {
-    u64 mfn_to_pfn_start;      /* MFN of start of m2p table */
-    u64 pfn_to_mfn_frame_list; /* MFN of a table of MFNs that 
-                                 make up p2m table */
-} PACKED arch_shared_info_t;
-
-#define ARCH_HAS_FAST_TRAP
-
-#endif
-
-#endif
diff --git a/xen/include/hypervisor-ifs/arch-x86_64.h b/xen/include/hypervisor-ifs/arch-x86_64.h
deleted file mode 100644 (file)
index 8eab08f..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-/******************************************************************************
- * arch-x86_64/hypervisor-if.h
- * 
- * Guest OS interface to AMD x86-64 bit Xen.
- */
-
-#ifndef __HYPERVISOR_IF_X86_64_H__
-#define __HYPERVISOR_IF_X86_64_H__
-
-/* Pointers are naturally 64 bits in this architecture; no padding needed. */
-#define _MEMORY_PADDING(_X)
-#define MEMORY_PADDING 
-
-/*
- * SEGMENT DESCRIPTOR TABLES
- */
-/*
- * A number of GDT entries are reserved by Xen. These are not situated at the
- * start of the GDT because some stupid OSes export hard-coded selector values
- * in their ABI. These hard-coded values are always near the start of the GDT,
- * so Xen places itself out of the way.
- * 
- * NB. The reserved range is inclusive (that is, both FIRST_RESERVED_GDT_ENTRY
- * and LAST_RESERVED_GDT_ENTRY are reserved).
- */
-#define NR_RESERVED_GDT_ENTRIES    40 
-#define FIRST_RESERVED_GDT_ENTRY   256
-#define LAST_RESERVED_GDT_ENTRY    \
-  (FIRST_RESERVED_GDT_ENTRY + NR_RESERVED_GDT_ENTRIES - 1)
-
-/*
- * 64-bit segment selectors
- * These flat segments are in the Xen-private section of every GDT. Since these
- * are also present in the initial GDT, many OSes will be able to avoid
- * installing their own GDT.
- */
-
-#define FLAT_RING3_CS32 0x0823  /* GDT index 260 */
-#define FLAT_RING3_CS64 0x082b  /* GDT index 261 */
-#define FLAT_RING3_DS   0x0833  /* GDT index 262 */
-
-#define FLAT_GUESTOS_DS   FLAT_RING3_DS
-#define FLAT_GUESTOS_CS   FLAT_RING3_CS64
-#define FLAT_GUESTOS_CS32 FLAT_RING3_CS32
-
-#define FLAT_USER_DS      FLAT_RING3_DS
-#define FLAT_USER_CS      FLAT_RING3_CS64
-#define FLAT_USER_CS32    FLAT_RING3_CS32
-
-/* And the trap vector is... */
-#define TRAP_INSTR "syscall"
-
-/* The machine->physical mapping table starts at this address, read-only. */
-#ifndef machine_to_phys_mapping
-#define machine_to_phys_mapping ((unsigned long *)0xffff810000000000ULL)
-#endif
-
-#ifndef __ASSEMBLY__
-
-/* NB. Both the following are 64 bits each. */
-typedef unsigned long memory_t;   /* Full-sized pointer/address/memory-size. */
-typedef unsigned long cpureg_t;   /* Full-sized register.                    */
-
-/*
- * Send an array of these to HYPERVISOR_set_trap_table()
- */
-#define TI_GET_DPL(_ti)      ((_ti)->flags & 3)
-#define TI_GET_IF(_ti)       ((_ti)->flags & 4)
-#define TI_SET_DPL(_ti,_dpl) ((_ti)->flags |= (_dpl))
-#define TI_SET_IF(_ti,_if)   ((_ti)->flags |= ((!!(_if))<<2))
-typedef struct {
-    u8       vector;  /* 0: exception vector                              */
-    u8       flags;   /* 1: 0-3: privilege level; 4: clear event enable?  */
-    u16      cs;      /* 2: code selector                                 */
-    u32      __pad;   /* 4 */
-    memory_t address; /* 8: code address                                  */
-} PACKED trap_info_t; /* 16 bytes */
-
-typedef struct
-{
-    unsigned long r15;
-    unsigned long r14;
-    unsigned long r13;
-    unsigned long r12;
-    unsigned long rbp;
-    unsigned long rbx;
-    unsigned long r11;
-    unsigned long r10;
-    unsigned long r9;
-    unsigned long r8;
-    unsigned long rax;
-    unsigned long rcx;
-    unsigned long rdx;
-    unsigned long rsi;
-    unsigned long rdi;
-    unsigned long rip;
-    unsigned long cs;
-    unsigned long eflags;
-    unsigned long rsp;
-    unsigned long ss;
-} PACKED execution_context_t;
-
-typedef u64 tsc_timestamp_t; /* RDTSC timestamp */
-
-/*
- * The following is all CPU context. Note that the i387_ctxt block is filled 
- * in by FXSAVE if the CPU has feature FXSR; otherwise FSAVE is used.
- */
-typedef struct {
-#define ECF_I387_VALID (1<<0)
-    unsigned long flags;
-    execution_context_t cpu_ctxt;           /* User-level CPU registers     */
-    char          fpu_ctxt[512];            /* User-level FPU registers     */
-    trap_info_t   trap_ctxt[256];           /* Virtual IDT                  */
-    unsigned long ldt_base, ldt_ents;       /* LDT (linear address, # ents) */
-    unsigned long gdt_frames[16], gdt_ents; /* GDT (machine frames, # ents) */
-    unsigned long guestos_ss, guestos_esp;  /* Virtual TSS (only SS1/ESP1)  */
-    unsigned long pt_base;                  /* CR3 (pagetable base)         */
-    unsigned long debugreg[8];              /* DB0-DB7 (debug registers)    */
-    unsigned long event_callback_cs;        /* CS:EIP of event callback     */
-    unsigned long event_callback_eip;
-    unsigned long failsafe_callback_cs;     /* CS:EIP of failsafe callback  */
-    unsigned long failsafe_callback_eip;
-} PACKED full_execution_context_t;
-
-typedef struct {
-    u64 mfn_to_pfn_start;      /* MFN of start of m2p table */
-    u64 pfn_to_mfn_frame_list; /* MFN of a table of MFNs that 
-                                 make up p2m table */
-} PACKED arch_shared_info_t;
-
-#endif /* !__ASSEMBLY__ */
-
-#endif /* __HYPERVISOR_IF_H__ */
diff --git a/xen/include/hypervisor-ifs/dom0_ops.h b/xen/include/hypervisor-ifs/dom0_ops.h
deleted file mode 100644 (file)
index 05eaa4a..0000000
+++ /dev/null
@@ -1,372 +0,0 @@
-/******************************************************************************
- * dom0_ops.h
- * 
- * Process command requests from domain-0 guest OS.
- * 
- * Copyright (c) 2002-2003, B Dragovic
- * Copyright (c) 2002-2004, K Fraser
- */
-
-
-#ifndef __DOM0_OPS_H__
-#define __DOM0_OPS_H__
-
-#include "hypervisor-if.h"
-#include "sched_ctl.h"
-
-/*
- * Make sure you increment the interface version whenever you modify this file!
- * This makes sure that old versions of dom0 tools will stop working in a
- * well-defined way (rather than crashing the machine, for instance).
- */
-#define DOM0_INTERFACE_VERSION   0xAAAA0019
-
-/************************************************************************/
-
-#define DOM0_GETMEMLIST        2
-typedef struct {
-    /* IN variables. */
-    domid_t       domain;             /*  0 */
-    u16           __pad0;
-    u32           __pad1;
-    memory_t      max_pfns;           /*  8 */
-    MEMORY_PADDING;
-    void         *buffer;             /* 16 */
-    MEMORY_PADDING;
-    /* OUT variables. */
-    memory_t      num_pfns;           /* 24 */
-    MEMORY_PADDING;
-} PACKED dom0_getmemlist_t; /* 32 bytes */
-
-#define DOM0_SCHEDCTL          6
- /* struct sched_ctl_cmd is from sched-ctl.h   */
-typedef struct sched_ctl_cmd dom0_schedctl_t;
-
-#define DOM0_ADJUSTDOM         7
-/* struct sched_adjdom_cmd is from sched-ctl.h */
-typedef struct sched_adjdom_cmd dom0_adjustdom_t;
-
-#define DOM0_CREATEDOMAIN      8
-typedef struct {
-    /* IN parameters. */
-    memory_t     memory_kb;           /*  0 */
-    MEMORY_PADDING;
-    u32          cpu;                 /*  8 */
-    u32          __pad0;              /* 12 */
-    /* IN/OUT parameters. */
-    /* If 0, domain is allocated. If non-zero use it unless in use. */
-    domid_t      domain;              /* 16 */
-    u16          __pad1;
-    /* OUT parameters. */
-} PACKED dom0_createdomain_t; /* 20 bytes */
-
-#define DOM0_DESTROYDOMAIN     9
-typedef struct {
-    /* IN variables. */
-    domid_t      domain;              /*  0 */
-    u16          __pad;
-} PACKED dom0_destroydomain_t; /* 4 bytes */
-
-#define DOM0_PAUSEDOMAIN      10
-typedef struct {
-    /* IN parameters. */
-    domid_t domain;                   /*  0 */
-    u16     __pad;
-} PACKED dom0_pausedomain_t; /* 4 bytes */
-
-#define DOM0_UNPAUSEDOMAIN    11
-typedef struct {
-    /* IN parameters. */
-    domid_t domain;                   /*  0 */
-    u16     __pad;
-} PACKED dom0_unpausedomain_t; /* 4 bytes */
-
-#define DOM0_GETDOMAININFO    12
-typedef struct {
-    /* IN variables. */
-    domid_t  domain;                  /*  0 */ /* NB. IN/OUT variable. */
-    u16     __pad;
-    /* OUT variables. */
-#define DOMFLAGS_DYING     (1<<0) /* Domain is scheduled to die.             */
-#define DOMFLAGS_CRASHED   (1<<1) /* Crashed domain; frozen for postmortem.  */
-#define DOMFLAGS_SHUTDOWN  (1<<2) /* The guest OS has shut itself down.      */
-#define DOMFLAGS_PAUSED    (1<<3) /* Currently paused by control software.   */
-#define DOMFLAGS_BLOCKED   (1<<4) /* Currently blocked pending an event.     */
-#define DOMFLAGS_RUNNING   (1<<5) /* Domain is currently running.            */
-#define DOMFLAGS_CPUMASK      255 /* CPU to which this domain is bound.      */
-#define DOMFLAGS_CPUSHIFT       8
-#define DOMFLAGS_SHUTDOWNMASK 255 /* DOMFLAGS_SHUTDOWN guest-supplied code.  */
-#define DOMFLAGS_SHUTDOWNSHIFT 16
-    u32      flags;                   /*  4 */
-    full_execution_context_t *ctxt;   /*  8 */ /* NB. IN/OUT variable. */
-    MEMORY_PADDING;
-    memory_t tot_pages;               /* 16 */
-    MEMORY_PADDING;
-    memory_t max_pages;               /* 24 */
-    MEMORY_PADDING;
-    memory_t shared_info_frame;       /* 32: MFN of shared_info struct */
-    MEMORY_PADDING;
-    u64      cpu_time;                /* 40 */
-} PACKED dom0_getdomaininfo_t; /* 48 bytes */
-
-#define DOM0_BUILDDOMAIN      13
-typedef struct {
-    /* IN variables. */
-    domid_t                 domain;   /*  0 */
-    u16                     __pad0;   /*  2 */
-    u32                     __pad1;   /*  4 */
-    /* IN/OUT parameters */
-    full_execution_context_t *ctxt;   /*  8 */
-    MEMORY_PADDING;
-} PACKED dom0_builddomain_t; /* 16 bytes */
-
-#define DOM0_IOPL             14
-typedef struct {
-    domid_t domain;                   /*  0 */
-    u16     __pad;
-    u32     iopl;                     /*  4 */
-} PACKED dom0_iopl_t; /* 8 bytes */
-
-#define DOM0_MSR              15
-typedef struct {
-    /* IN variables. */
-    u32 write;                        /*  0 */
-    u32 cpu_mask;                     /*  4 */
-    u32 msr;                          /*  8 */
-    u32 in1;                          /* 12 */
-    u32 in2;                          /* 16 */
-    /* OUT variables. */
-    u32 out1;                         /* 20 */
-    u32 out2;                         /* 24 */
-} PACKED dom0_msr_t; /* 28 bytes */
-
-#define DOM0_DEBUG            16
-typedef struct {
-    /* IN variables. */
-    domid_t domain;                   /*  0 */
-    u8  opcode;                       /*  2 */
-    u8  __pad;
-    u32 in1;                          /*  4 */
-    u32 in2;                          /*  8 */
-    u32 in3;                          /* 12 */
-    u32 in4;                          /* 16 */
-    /* OUT variables. */
-    u32 status;                       /* 20 */
-    u32 out1;                         /* 24 */
-    u32 out2;                         /* 28 */
-} PACKED dom0_debug_t; /* 32 bytes */
-
-/*
- * Set clock such that it would read <secs,usecs> after 00:00:00 UTC,
- * 1 January, 1970 if the current system time was <system_time>.
- */
-#define DOM0_SETTIME          17
-typedef struct {
-    /* IN variables. */
-    u32 secs;                         /*  0 */
-    u32 usecs;                        /*  4 */
-    u64 system_time;                  /*  8 */
-} PACKED dom0_settime_t; /* 16 bytes */
-
-#define DOM0_GETPAGEFRAMEINFO 18
-#define NOTAB 0         /* normal page */
-#define L1TAB (1<<28)
-#define L2TAB (2<<28)
-#define L3TAB (3<<28)
-#define L4TAB (4<<28)
-#define LPINTAB  (1<<31)
-#define XTAB  (0xf<<28) /* invalid page */
-#define LTAB_MASK XTAB
-#define LTABTYPE_MASK (0x7<<28)
-
-typedef struct {
-    /* IN variables. */
-    memory_t pfn;          /*  0: Machine page frame number to query.       */
-    MEMORY_PADDING;
-    domid_t domain;        /*  8: To which domain does the frame belong?    */
-    u16     __pad;
-    /* OUT variables. */
-    /* Is the page PINNED to a type? */
-    u32 type;              /* 12: see above type defs */
-} PACKED dom0_getpageframeinfo_t; /* 16 bytes */
-
-/*
- * Read console content from Xen buffer ring.
- */
-#define DOM0_READCONSOLE      19
-typedef struct {
-    memory_t str;                     /*  0 */
-    MEMORY_PADDING;
-    u32      count;                   /*  8 */
-    u32      cmd;                     /* 12 */
-} PACKED dom0_readconsole_t; /* 16 bytes */
-
-/* 
- * Pin Domain to a particular CPU  (use -1 to unpin)
- */
-#define DOM0_PINCPUDOMAIN     20
-typedef struct {
-    /* IN variables. */
-    domid_t      domain;              /*  0 */
-    u16          __pad;
-    s32          cpu;                 /*  4: -1 implies unpin */
-} PACKED dom0_pincpudomain_t; /* 8 bytes */
-
-/* Get trace buffers machine base address */
-#define DOM0_GETTBUFS         21
-typedef struct {
-    /* OUT variables */
-    memory_t mach_addr;   /*  0: location of the trace buffers       */
-    MEMORY_PADDING;
-    u32      size;        /*  8: size of each trace buffer, in bytes */
-} PACKED dom0_gettbufs_t; /* 12 bytes */
-
-/*
- * Get physical information about the host machine
- */
-#define DOM0_PHYSINFO         22
-typedef struct {
-    u32      ht_per_core;             /*  0 */
-    u32      cores;                   /*  4 */
-    u32      cpu_khz;                 /*  8 */
-    u32      __pad;                   /* 12 */
-    memory_t total_pages;             /* 16 */
-    MEMORY_PADDING;
-    memory_t free_pages;              /* 24 */
-    MEMORY_PADDING;
-} PACKED dom0_physinfo_t; /* 32 bytes */
-
-/* 
- * Allow a domain access to a physical PCI device
- */
-#define DOM0_PCIDEV_ACCESS    23
-typedef struct {
-    /* IN variables. */
-    domid_t      domain;              /*  0 */
-    u16          __pad;
-    u32          bus;                 /*  4 */
-    u32          dev;                 /*  8 */
-    u32          func;                /* 12 */
-    u32          enable;              /* 16 */
-} PACKED dom0_pcidev_access_t; /* 20 bytes */
-
-/*
- * Get the ID of the current scheduler.
- */
-#define DOM0_SCHED_ID        24
-typedef struct {
-    /* OUT variable */
-    u32 sched_id;                     /*  0 */
-} PACKED dom0_sched_id_t; /* 4 bytes */
-
-/* 
- * Control shadow pagetables operation
- */
-#define DOM0_SHADOW_CONTROL  25
-
-#define DOM0_SHADOW_CONTROL_OP_OFF         0
-#define DOM0_SHADOW_CONTROL_OP_ENABLE_TEST 1
-#define DOM0_SHADOW_CONTROL_OP_ENABLE_LOGDIRTY 2
-#define DOM0_SHADOW_CONTROL_OP_ENABLE_TRANSLATE 3
-#define DOM0_SHADOW_CONTROL_OP_FLUSH       10     /* table ops */
-#define DOM0_SHADOW_CONTROL_OP_CLEAN       11
-#define DOM0_SHADOW_CONTROL_OP_PEEK        12
-
-typedef struct dom0_shadow_control
-{
-    u32 fault_count;
-    u32 dirty_count;
-    u32 dirty_net_count;     
-    u32 dirty_block_count;     
-} dom0_shadow_control_stats_t;
-
-typedef struct {
-    /* IN variables. */
-    domid_t        domain;            /*  0 */
-    u16            __pad;
-    u32            op;                /*  4 */
-    unsigned long *dirty_bitmap;      /*  8: pointer to locked buffer */
-    MEMORY_PADDING;
-    /* IN/OUT variables. */
-    memory_t       pages;  /* 16: size of buffer, updated with actual size */
-    MEMORY_PADDING;
-    /* OUT variables. */
-    dom0_shadow_control_stats_t stats;
-} PACKED dom0_shadow_control_t;
-
-#define DOM0_SETDOMAININITIALMEM   27
-typedef struct {
-    /* IN variables. */
-    domid_t     domain;               /*  0 */
-    u16         __pad0;
-    u32         __pad1;
-    memory_t    initial_memkb;        /*  8 */
-    MEMORY_PADDING;
-} PACKED dom0_setdomaininitialmem_t; /* 16 bytes */
-
-#define DOM0_SETDOMAINMAXMEM   28
-typedef struct {
-    /* IN variables. */
-    domid_t     domain;               /*  0 */
-    u16         __pad0;
-    u32         __pad1;
-    memory_t    max_memkb;            /*  8 */
-    MEMORY_PADDING;
-} PACKED dom0_setdomainmaxmem_t; /* 16 bytes */
-
-#define DOM0_GETPAGEFRAMEINFO2 29   /* batched interface */
-typedef struct {
-    /* IN variables. */
-    domid_t  domain;                  /*  0 */
-    u16      __pad0;
-    u32      __pad1;
-    memory_t num;                     /*  8 */
-    MEMORY_PADDING;
-    /* IN/OUT variables. */
-    unsigned long *array;             /* 16 */
-    MEMORY_PADDING;
-} PACKED dom0_getpageframeinfo2_t; /* 24 bytes */
-
-#define DOM0_SETDOMAINVMASSIST   30
-typedef struct {
-    /* IN variables. */
-    domid_t      domain;              /*  0 */
-    u16          __pad0;
-    u32          cmd;                 /*  4: vm_assist cmd */
-    u32          type;                /*  8: vm_assist cmd */
-} PACKED dom0_setdomainvmassist_t; /* 12 bytes */
-
-typedef struct {
-    u32 cmd;                          /* 0 */
-    u32 interface_version;            /* 4 */ /* DOM0_INTERFACE_VERSION */
-    union {                           /* 8 */
-       u32                      dummy[18]; /* 72 bytes */
-        dom0_createdomain_t      createdomain;
-        dom0_pausedomain_t       pausedomain;
-        dom0_unpausedomain_t     unpausedomain;
-        dom0_destroydomain_t     destroydomain;
-        dom0_getmemlist_t        getmemlist;
-        dom0_schedctl_t          schedctl;
-        dom0_adjustdom_t         adjustdom;
-        dom0_builddomain_t       builddomain;
-        dom0_getdomaininfo_t     getdomaininfo;
-        dom0_getpageframeinfo_t  getpageframeinfo;
-        dom0_iopl_t              iopl;
-       dom0_msr_t               msr;
-       dom0_debug_t             debug;
-       dom0_settime_t           settime;
-       dom0_readconsole_t       readconsole;
-       dom0_pincpudomain_t      pincpudomain;
-        dom0_gettbufs_t          gettbufs;
-        dom0_physinfo_t          physinfo;
-        dom0_pcidev_access_t     pcidev_access;
-        dom0_sched_id_t          sched_id;
-       dom0_shadow_control_t    shadow_control;
-       dom0_setdomaininitialmem_t setdomaininitialmem;
-       dom0_setdomainmaxmem_t   setdomainmaxmem;
-       dom0_getpageframeinfo2_t getpageframeinfo2;
-       dom0_setdomainvmassist_t setdomainvmassist;
-    } PACKED u;
-} PACKED dom0_op_t; /* 80 bytes */
-
-#endif /* __DOM0_OPS_H__ */
diff --git a/xen/include/hypervisor-ifs/event_channel.h b/xen/include/hypervisor-ifs/event_channel.h
deleted file mode 100644 (file)
index 2da4f06..0000000
+++ /dev/null
@@ -1,161 +0,0 @@
-/******************************************************************************
- * event_channel.h
- * 
- * Event channels between domains.
- * 
- * Copyright (c) 2003-2004, K A Fraser.
- */
-
-#ifndef __HYPERVISOR_IFS__EVENT_CHANNEL_H__
-#define __HYPERVISOR_IFS__EVENT_CHANNEL_H__
-
-/*
- * EVTCHNOP_alloc_unbound: Allocate a fresh local port and prepare
- * it for binding to <dom>.
- */
-#define EVTCHNOP_alloc_unbound    6
-typedef struct {
-    /* IN parameters */
-    domid_t dom;                      /*  0 */
-    u16     __pad;
-    /* OUT parameters */
-    u32     port;                     /*  4 */
-} PACKED evtchn_alloc_unbound_t; /* 8 bytes */
-
-/*
- * EVTCHNOP_bind_interdomain: Construct an interdomain event channel between
- * <dom1> and <dom2>. Either <port1> or <port2> may be wildcarded by setting to
- * zero. On successful return both <port1> and <port2> are filled in and
- * <dom1,port1> is fully bound to <dom2,port2>.
- * 
- * NOTES:
- *  1. A wildcarded port is allocated from the relevant domain's free list
- *     (i.e., some port that was previously EVTCHNSTAT_closed). However, if the
- *     remote port pair is already fully bound then a port is not allocated,
- *     and instead the existing local port is returned to the caller.
- *  2. If the caller is unprivileged then <dom1> must be DOMID_SELF.
- *  3. If the caller is unprivileged and <dom2,port2> is EVTCHNSTAT_closed
- *     then <dom2> must be DOMID_SELF.
- *  4. If either port is already bound then it must be bound to the other
- *     specified domain and port (if not wildcarded).
- *  5. If either port is awaiting binding (EVTCHNSTAT_unbound) then it must
- *     be awaiting binding to the other domain, and the other port pair must
- *     be closed or unbound.
- */
-#define EVTCHNOP_bind_interdomain 0
-typedef struct {
-    /* IN parameters. */
-    domid_t dom1, dom2;               /*  0,  2 */
-    /* IN/OUT parameters. */
-    u32     port1, port2;             /*  4,  8 */
-} PACKED evtchn_bind_interdomain_t; /* 12 bytes */
-
-/*
- * EVTCHNOP_bind_virq: Bind a local event channel to IRQ <irq>.
- * NOTES:
- *  1. A virtual IRQ may be bound to at most one event channel per domain.
- */
-#define EVTCHNOP_bind_virq        1
-typedef struct {
-    /* IN parameters. */
-    u32 virq;                         /*  0 */
-    /* OUT parameters. */
-    u32 port;                         /*  4 */
-} PACKED evtchn_bind_virq_t; /* 8 bytes */
-
-/*
- * EVTCHNOP_bind_pirq: Bind a local event channel to IRQ <irq>.
- * NOTES:
- *  1. A physical IRQ may be bound to at most one event channel per domain.
- *  2. Only a sufficiently-privileged domain may bind to a physical IRQ.
- */
-#define EVTCHNOP_bind_pirq        2
-typedef struct {
-    /* IN parameters. */
-    u32 pirq;                         /*  0 */
-#define BIND_PIRQ__WILL_SHARE 1
-    u32 flags; /* BIND_PIRQ__* */     /*  4 */
-    /* OUT parameters. */
-    u32 port;                         /*  8 */
-} PACKED evtchn_bind_pirq_t; /* 12 bytes */
-
-/*
- * EVTCHNOP_close: Close the communication channel which has an endpoint at
- * <dom, port>. If the channel is interdomain then the remote end is placed in
- * the unbound state (EVTCHNSTAT_unbound), awaiting a new connection.
- * NOTES:
- *  1. <dom> may be specified as DOMID_SELF.
- *  2. Only a sufficiently-privileged domain may close an event channel
- *     for which <dom> is not DOMID_SELF.
- */
-#define EVTCHNOP_close            3
-typedef struct {
-    /* IN parameters. */
-    domid_t dom;                      /*  0 */
-    u16     __pad;
-    u32     port;                     /*  4 */
-    /* No OUT parameters. */
-} PACKED evtchn_close_t; /* 8 bytes */
-
-/*
- * EVTCHNOP_send: Send an event to the remote end of the channel whose local
- * endpoint is <DOMID_SELF, local_port>.
- */
-#define EVTCHNOP_send             4
-typedef struct {
-    /* IN parameters. */
-    u32     local_port;               /*  0 */
-    /* No OUT parameters. */
-} PACKED evtchn_send_t; /* 4 bytes */
-
-/*
- * EVTCHNOP_status: Get the current status of the communication channel which
- * has an endpoint at <dom, port>.
- * NOTES:
- *  1. <dom> may be specified as DOMID_SELF.
- *  2. Only a sufficiently-privileged domain may obtain the status of an event
- *     channel for which <dom> is not DOMID_SELF.
- */
-#define EVTCHNOP_status           5
-typedef struct {
-    /* IN parameters */
-    domid_t dom;                      /*  0 */
-    u16     __pad;
-    u32     port;                     /*  4 */
-    /* OUT parameters */
-#define EVTCHNSTAT_closed       0  /* Channel is not in use.                 */
-#define EVTCHNSTAT_unbound      1  /* Channel is waiting interdom connection.*/
-#define EVTCHNSTAT_interdomain  2  /* Channel is connected to remote domain. */
-#define EVTCHNSTAT_pirq         3  /* Channel is bound to a phys IRQ line.   */
-#define EVTCHNSTAT_virq         4  /* Channel is bound to a virtual IRQ line */
-    u32     status;                   /*  8 */
-    union {                           /* 12 */
-        struct {
-            domid_t dom;                              /* 12 */
-        } PACKED unbound; /* EVTCHNSTAT_unbound */
-        struct {
-            domid_t dom;                              /* 12 */
-            u16     __pad;
-            u32     port;                             /* 16 */
-        } PACKED interdomain; /* EVTCHNSTAT_interdomain */
-        u32 pirq;      /* EVTCHNSTAT_pirq        */   /* 12 */
-        u32 virq;      /* EVTCHNSTAT_virq        */   /* 12 */
-    } PACKED u;
-} PACKED evtchn_status_t; /* 20 bytes */
-
-typedef struct {
-    u32 cmd; /* EVTCHNOP_* */         /*  0 */
-    u32 __reserved;                   /*  4 */
-    union {                           /*  8 */
-        evtchn_alloc_unbound_t    alloc_unbound;
-        evtchn_bind_interdomain_t bind_interdomain;
-        evtchn_bind_virq_t        bind_virq;
-        evtchn_bind_pirq_t        bind_pirq;
-        evtchn_close_t            close;
-        evtchn_send_t             send;
-        evtchn_status_t           status;
-        u8                        __dummy[24];
-    } PACKED u;
-} PACKED evtchn_op_t; /* 32 bytes */
-
-#endif /* __HYPERVISOR_IFS__EVENT_CHANNEL_H__ */
diff --git a/xen/include/hypervisor-ifs/grant_table.h b/xen/include/hypervisor-ifs/grant_table.h
deleted file mode 100644 (file)
index cb48c1f..0000000
+++ /dev/null
@@ -1,251 +0,0 @@
-/******************************************************************************
- * grant_table.h
- * 
- * Interface for granting foreign access to page frames, and receiving
- * page-ownership transfers.
- * 
- * Copyright (c) 2004, K A Fraser
- */
-
-#ifndef __HYPERVISOR_IFS_GRANT_TABLE_H__
-#define __HYPERVISOR_IFS_GRANT_TABLE_H__
-
-
-/***********************************
- * GRANT TABLE REPRESENTATION
- */
-
-/* Some rough guidelines on accessing and updating grant-table entries
- * in a concurrency-safe manner. For more information, Linux contains a
- * reference implementation for guest OSes (arch/xen/kernel/grant_table.c).
- * 
- * NB. WMB is a no-op on current-generation x86 processors. However, a
- *     compiler barrier will still be required.
- * 
- * Introducing a valid entry into the grant table:
- *  1. Write ent->domid.
- *  2. Write ent->frame:
- *      GTF_permit_access:   Frame to which access is permitted.
- *      GTF_accept_transfer: Pseudo-phys frame slot being filled by new
- *                           frame, or zero if none.
- *  3. Write memory barrier (WMB).
- *  4. Write ent->flags, inc. valid type.
- * 
- * Invalidating an unused GTF_permit_access entry:
- *  1. flags = ent->flags.
- *  2. Observe that !(flags & (GTF_reading|GTF_writing)).
- *  3. Check result of SMP-safe CMPXCHG(&ent->flags, flags, 0).
- *  NB. No need for WMB as reuse of entry is control-dependent on success of
- *      step 3, and all architectures guarantee ordering of ctrl-dep writes.
- *
- * Invalidating an in-use GTF_permit_access entry:
- *  This cannot be done directly. Request assistance from the domain controller
- *  which can set a timeout on the use of a grant entry and take necessary
- *  action. (NB. This is not yet implemented!).
- * 
- * Invalidating an unused GTF_accept_transfer entry:
- *  1. flags = ent->flags.
- *  2. Observe that !(flags & GTF_transfer_committed). [*]
- *  3. Check result of SMP-safe CMPXCHG(&ent->flags, flags, 0).
- *  NB. No need for WMB as reuse of entry is control-dependent on success of
- *      step 3, and all architectures guarantee ordering of ctrl-dep writes.
- *  [*] If GTF_transfer_committed is set then the grant entry is 'committed'.
- *      The guest must /not/ modify the grant entry until the address of the
- *      transferred frame is written. It is safe for the guest to spin waiting
- *      for this to occur (detect by observing GTF_transfer_completed in
- *      ent->flags).
- *
- * Invalidating a committed GTF_accept_transfer entry:
- *  1. Wait for (ent->flags & GTF_transfer_completed).
- *
- * Changing a GTF_permit_access from writable to read-only:
- *  Use SMP-safe CMPXCHG to set GTF_readonly, while checking !GTF_writing.
- * 
- * Changing a GTF_permit_access from read-only to writable:
- *  Use SMP-safe bit-setting instruction.
- */
-
-/*
- * A grant table comprises a packed array of grant entries in one or more
- * page frames shared between Xen and a guest.
- * [XEN]: This field is written by Xen and read by the sharing guest.
- * [GST]: This field is written by the guest and read by Xen.
- */
-typedef struct {
-    /* GTF_xxx: various type and flag information.  [XEN,GST] */
-    u16     flags;      /* 0 */
-    /* The domain being granted foreign privileges. [GST] */
-    domid_t domid;      /* 2 */
-    /*
-     * GTF_permit_access: Frame that @domid is allowed to map and access. [GST]
-     * GTF_accept_transfer: Frame whose ownership transferred by @domid. [XEN]
-     */
-    u32     frame;      /* 4 */
-} PACKED grant_entry_t; /* 8 bytes */
-
-/*
- * Type of grant entry.
- *  GTF_invalid: This grant entry grants no privileges.
- *  GTF_permit_access: Allow @domid to map/access @frame.
- *  GTF_accept_transfer: Allow @domid to transfer ownership of one page frame
- *                       to this guest. Xen writes the page number to @frame.
- */
-#define GTF_invalid         (0U<<0)
-#define GTF_permit_access   (1U<<0)
-#define GTF_accept_transfer (2U<<0)
-#define GTF_type_mask       (3U<<0)
-
-/*
- * Subflags for GTF_permit_access.
- *  GTF_readonly: Restrict @domid to read-only mappings and accesses. [GST]
- *  GTF_reading: Grant entry is currently mapped for reading by @domid. [XEN]
- *  GTF_writing: Grant entry is currently mapped for writing by @domid. [XEN]
- */
-#define _GTF_readonly       (2)
-#define GTF_readonly        (1U<<_GTF_readonly)
-#define _GTF_reading        (3)
-#define GTF_reading         (1U<<_GTF_reading)
-#define _GTF_writing        (4)
-#define GTF_writing         (1U<<_GTF_writing)
-
-/*
- * Subflags for GTF_accept_transfer:
- *  GTF_transfer_committed: Xen sets this flag to indicate that it is committed
- *      to transferring ownership of a page frame. When a guest sees this flag
- *      it must /not/ modify the grant entry until GTF_transfer_completed is
- *      set by Xen.
- *  GTF_transfer_completed: It is safe for the guest to spin-wait on this flag
- *      after reading GTF_transfer_committed. Xen will always write the frame
- *      address, followed by ORing this flag, in a timely manner.
- */
-#define _GTF_transfer_committed (2)
-#define GTF_transfer_committed  (1U<<_GTF_transfer_committed)
-#define _GTF_transfer_completed (3)
-#define GTF_transfer_completed  (1U<<_GTF_transfer_completed)
-
-
-/***********************************
- * GRANT TABLE QUERIES AND USES
- */
-
-/*
- * Reference to a grant entry in a specified domain's grant table.
- */
-typedef u16 grant_ref_t;
-
-/*
- * GNTTABOP_map_grant_ref: Map the grant entry (<dom>,<ref>) for access
- * by devices and/or host CPUs. If successful, <handle> is a tracking number
- * that must be presented later to destroy the mapping(s). On error, <handle>
- * is a negative status code.
- * NOTES:
- *  1. If GNTPIN_map_for_dev is specified then <dev_bus_addr> is the address
- *     via which I/O devices may access the granted frame.
- *  2. If GNTPIN_map_for_host is specified then a mapping will be added at
- *     virtual address <host_virt_addr> in the current address space.
- *  3. Mappings should only be destroyed via GNTTABOP_unmap_grant_ref. If a
- *     host mapping is destroyed by other means then it is *NOT* guaranteed
- *     to be accounted to the correct grant reference!
- */
-#define GNTTABOP_map_grant_ref        0
-typedef struct {
-    /* IN parameters. */
-    memory_t    host_virt_addr;       /*  0 */
-    MEMORY_PADDING;
-    domid_t     dom;                  /*  8 */
-    grant_ref_t ref;                  /* 10 */
-    u16         flags;                /* 12: GNTMAP_* */
-    /* OUT parameters. */
-    s16         handle;               /* 14: +ve: handle; -ve: GNTST_* */
-    memory_t    dev_bus_addr;         /* 16 */
-    MEMORY_PADDING;
-} PACKED gnttab_map_grant_ref_t; /* 24 bytes */
-
-/*
- * GNTTABOP_unmap_grant_ref: Destroy one or more grant-reference mappings
- * tracked by <handle>. If <host_virt_addr> or <dev_bus_addr> is zero, that
- * field is ignored. If non-zero, they must refer to a device/host mapping
- * that is tracked by <handle>
- * NOTES:
- *  1. The call may fail in an undefined manner if either mapping is not
- *     tracked by <handle>.
- *  3. After executing a batch of unmaps, it is guaranteed that no stale
- *     mappings will remain in the device or host TLBs.
- */
-#define GNTTABOP_unmap_grant_ref      1
-typedef struct {
-    /* IN parameters. */
-    memory_t    host_virt_addr;       /*  0 */
-    MEMORY_PADDING;
-    memory_t    dev_bus_addr;         /*  8 */
-    MEMORY_PADDING;
-    u16         handle;               /* 16 */
-    /* OUT parameters. */
-    s16         status;               /* 18: GNTST_* */
-    u32         __pad;
-} PACKED gnttab_unmap_grant_ref_t; /* 24 bytes */
-
-/*
- * GNTTABOP_setup_table: Set up a grant table for <dom> comprising at least
- * <nr_frames> pages. The frame addresses are written to the <frame_list>.
- * Only <nr_frames> addresses are written, even if the table is larger.
- * NOTES:
- *  1. <dom> may be specified as DOMID_SELF.
- *  2. Only a sufficiently-privileged domain may specify <dom> != DOMID_SELF.
- *  3. Xen may not support more than a single grant-table page per domain.
- */
-#define GNTTABOP_setup_table          2
-typedef struct {
-    /* IN parameters. */
-    domid_t     dom;                  /*  0 */
-    u16         nr_frames;            /*  2 */
-    u16         __pad;
-    /* OUT parameters. */
-    s16         status;               /*  6: GNTST_* */
-    unsigned long *frame_list;        /*  8 */
-    MEMORY_PADDING;
-} PACKED gnttab_setup_table_t; /* 16 bytes */
-
-/*
- * Bitfield values for update_pin_status.flags.
- */
- /* Map the grant entry for access by I/O devices. */
-#define _GNTMAP_device_map      (0)
-#define GNTMAP_device_map       (1<<_GNTMAP_device_map)
- /* Map the grant entry for access by host CPUs. */
-#define _GNTMAP_host_map        (1)
-#define GNTMAP_host_map         (1<<_GNTMAP_host_map)
- /* Accesses to the granted frame will be restricted to read-only access. */
-#define _GNTMAP_readonly        (2)
-#define GNTMAP_readonly         (1<<_GNTMAP_readonly)
- /*
-  * GNTMAP_host_map subflag:
-  *  0 => The host mapping is usable only by the guest OS.
-  *  1 => The host mapping is usable by guest OS + current application.
-  */
-#define _GNTMAP_application_map (3)
-#define GNTMAP_application_map  (1<<_GNTMAP_application_map)
-
-/*
- * Values for error status returns. All errors are -ve.
- */
-#define GNTST_okay             (0)
-#define GNTST_general_error    (-1) /* General undefined error.              */
-#define GNTST_bad_domain       (-2) /* Unrecognsed domain id.                */
-#define GNTST_bad_gntref       (-3) /* Unrecognised or inappropriate gntref. */
-#define GNTST_bad_handle       (-3) /* Unrecognised or inappropriate handle. */
-#define GNTST_no_device_space  (-4) /* Out of space in I/O MMU.              */
-#define GNTST_permission_denied (-5) /* Not enough privilege for operation.  */
-
-#define GNTTABOP_error_msgs {                   \
-    "okay",                                     \
-    "undefined error",                          \
-    "unrecognised domain id",                   \
-    "invalid grant reference",                  \
-    "invalid mapping handle",                   \
-    "no spare translation slot in the I/O MMU", \
-    "permission denied"                         \
-}
-        
-
-#endif /* __HYPERVISOR_IFS_GRANT_TABLE_H__ */
diff --git a/xen/include/hypervisor-ifs/hypervisor-if.h b/xen/include/hypervisor-ifs/hypervisor-if.h
deleted file mode 100644 (file)
index 1038d3c..0000000
+++ /dev/null
@@ -1,425 +0,0 @@
-/******************************************************************************
- * hypervisor-if.h
- * 
- * Guest OS interface to Xen.
- * 
- * Copyright (c) 2004, K A Fraser
- */
-
-#ifndef __HYPERVISOR_IF_H__
-#define __HYPERVISOR_IF_H__
-
-/* GCC-specific way to pack structure definitions (no implicit padding). */
-#define PACKED __attribute__ ((packed))
-
-#if defined(__i386__)
-#include "arch-x86_32.h"
-#elif defined(__x86_64__)
-#include "arch-x86_64.h"
-#else
-#error "Unsupported architecture"
-#endif
-
-/*
- * HYPERVISOR "SYSTEM CALLS"
- */
-
-/* EAX = vector; EBX, ECX, EDX, ESI, EDI = args 1, 2, 3, 4, 5. */
-#define __HYPERVISOR_set_trap_table        0
-#define __HYPERVISOR_mmu_update            1
-#define __HYPERVISOR_set_gdt               2
-#define __HYPERVISOR_stack_switch          3
-#define __HYPERVISOR_set_callbacks         4
-#define __HYPERVISOR_fpu_taskswitch        5
-#define __HYPERVISOR_sched_op              6
-#define __HYPERVISOR_dom0_op               7
-#define __HYPERVISOR_set_debugreg          8
-#define __HYPERVISOR_get_debugreg          9
-#define __HYPERVISOR_update_descriptor    10
-#define __HYPERVISOR_set_fast_trap        11
-#define __HYPERVISOR_dom_mem_op           12
-#define __HYPERVISOR_multicall            13
-#define __HYPERVISOR_update_va_mapping    14
-#define __HYPERVISOR_set_timer_op         15
-#define __HYPERVISOR_event_channel_op     16
-#define __HYPERVISOR_xen_version          17
-#define __HYPERVISOR_console_io           18
-#define __HYPERVISOR_physdev_op           19
-#define __HYPERVISOR_grant_table_op       20
-#define __HYPERVISOR_vm_assist            21
-#define __HYPERVISOR_update_va_mapping_otherdomain 22
-
-/*
- * MULTICALLS
- * 
- * Multicalls are listed in an array, with each element being a fixed size 
- * (BYTES_PER_MULTICALL_ENTRY). Each is of the form (op, arg1, ..., argN)
- * where each element of the tuple is a machine word. 
- */
-#define ARGS_PER_MULTICALL_ENTRY 8
-
-
-/* 
- * VIRTUAL INTERRUPTS
- * 
- * Virtual interrupts that a guest OS may receive from the hypervisor.
- */
-#define VIRQ_MISDIRECT  0  /* Catch-all interrupt for unbound VIRQs.      */
-#define VIRQ_TIMER      1  /* Timebase update, and/or requested timeout.  */
-#define VIRQ_DEBUG      2  /* Request guest to dump debug info.           */
-#define VIRQ_CONSOLE    3  /* (DOM0) bytes received on emergency console. */
-#define VIRQ_DOM_EXC    4  /* (DOM0) Exceptional event for some domain.   */
-#define VIRQ_PARITY_ERR 5  /* (DOM0) NMI parity error.                    */
-#define VIRQ_IO_ERR     6  /* (DOM0) NMI I/O error.                       */
-#define NR_VIRQS        7
-
-/*
- * MMU-UPDATE REQUESTS
- * 
- * HYPERVISOR_mmu_update() accepts a list of (ptr, val) pairs.
- * ptr[1:0] specifies the appropriate MMU_* command.
- * 
- * FOREIGN DOMAIN (FD)
- * -------------------
- *  Some commands recognise an explicitly-declared foreign domain,
- *  in which case they will operate with respect to the foreigner rather than
- *  the calling domain. Where the FD has some effect, it is described below.
- * 
- * ptr[1:0] == MMU_NORMAL_PT_UPDATE:
- * Updates an entry in a page table. If updating an L1 table, and the new
- * table entry is valid/present, the mapped frame must belong to the FD, if
- * an FD has been specified. If attempting to map an I/O page then the
- * caller assumes the privilege of the FD.
- * FD == DOMID_IO: Permit /only/ I/O mappings, at the priv level of the caller.
- * FD == DOMID_XEN: Map restricted areas of Xen's heap space.
- * ptr[:2]  -- Machine address of the page-table entry to modify.
- * val      -- Value to write.
- * 
- * ptr[1:0] == MMU_MACHPHYS_UPDATE:
- * Updates an entry in the machine->pseudo-physical mapping table.
- * ptr[:2]  -- Machine address within the frame whose mapping to modify.
- *             The frame must belong to the FD, if one is specified.
- * val      -- Value to write into the mapping entry.
- *  
- * ptr[1:0] == MMU_EXTENDED_COMMAND:
- * val[7:0] -- MMUEXT_* command.
- * 
- *   val[7:0] == MMUEXT_(UN)PIN_*_TABLE:
- *   ptr[:2]  -- Machine address of frame to be (un)pinned as a p.t. page.
- *               The frame must belong to the FD, if one is specified.
- * 
- *   val[7:0] == MMUEXT_NEW_BASEPTR:
- *   ptr[:2]  -- Machine address of new page-table base to install in MMU.
- * 
- *   val[7:0] == MMUEXT_TLB_FLUSH:
- *   No additional arguments.
- * 
- *   val[7:0] == MMUEXT_INVLPG:
- *   ptr[:2]  -- Linear address to be flushed from the TLB.
- * 
- *   val[7:0] == MMUEXT_FLUSH_CACHE:
- *   No additional arguments. Writes back and flushes cache contents.
- * 
- *   val[7:0] == MMUEXT_SET_LDT:
- *   ptr[:2]  -- Linear address of LDT base (NB. must be page-aligned).
- *   val[:8]  -- Number of entries in LDT.
- * 
- *   val[7:0] == MMUEXT_TRANSFER_PAGE:
- *   val[31:16] -- Domain to whom page is to be transferred.
- *   (val[15:8],ptr[9:2]) -- 16-bit reference into transferee's grant table.
- *   ptr[:12]  -- Page frame to be reassigned to the FD.
- *                (NB. The frame must currently belong to the calling domain).
- * 
- *   val[7:0] == MMUEXT_SET_FOREIGNDOM:
- *   val[31:16] -- Domain to set as the Foreign Domain (FD).
- *                 (NB. DOMID_SELF is not recognised)
- *                 If FD != DOMID_IO then the caller must be privileged.
- * 
- *   val[7:0] == MMUEXT_CLEAR_FOREIGNDOM:
- *   Clears the FD.
- * 
- *   val[7:0] == MMUEXT_REASSIGN_PAGE:
- *   ptr[:2]  -- A machine address within the page to be reassigned to the FD.
- *               (NB. page must currently belong to the calling domain).
- */
-#define MMU_NORMAL_PT_UPDATE     0 /* checked '*ptr = val'. ptr is MA.       */
-#define MMU_MACHPHYS_UPDATE      2 /* ptr = MA of frame to modify entry for  */
-#define MMU_EXTENDED_COMMAND     3 /* least 8 bits of val demux further      */
-#define MMUEXT_PIN_L1_TABLE      0 /* ptr = MA of frame to pin               */
-#define MMUEXT_PIN_L2_TABLE      1 /* ptr = MA of frame to pin               */
-#define MMUEXT_PIN_L3_TABLE      2 /* ptr = MA of frame to pin               */
-#define MMUEXT_PIN_L4_TABLE      3 /* ptr = MA of frame to pin               */
-#define MMUEXT_UNPIN_TABLE       4 /* ptr = MA of frame to unpin             */
-#define MMUEXT_NEW_BASEPTR       5 /* ptr = MA of new pagetable base         */
-#define MMUEXT_TLB_FLUSH         6 /* ptr = NULL                             */
-#define MMUEXT_INVLPG            7 /* ptr = VA to invalidate                 */
-#define MMUEXT_FLUSH_CACHE       8
-#define MMUEXT_SET_LDT           9 /* ptr = VA of table; val = # entries     */
-#define MMUEXT_SET_FOREIGNDOM   10 /* val[31:16] = dom                       */
-#define MMUEXT_CLEAR_FOREIGNDOM 11
-#define MMUEXT_TRANSFER_PAGE    12 /* ptr = MA of frame; val[31:16] = dom    */
-#define MMUEXT_REASSIGN_PAGE    13
-#define MMUEXT_CMD_MASK        255
-#define MMUEXT_CMD_SHIFT         8
-
-/* These are passed as 'flags' to update_va_mapping. They can be ORed. */
-#define UVMF_FLUSH_TLB          1 /* Flush entire TLB. */
-#define UVMF_INVLPG             2 /* Flush the VA mapping being updated. */
-
-
-/*
- * Commands to HYPERVISOR_sched_op().
- */
-#define SCHEDOP_yield           0   /* Give up the CPU voluntarily.       */
-#define SCHEDOP_block           1   /* Block until an event is received.  */
-#define SCHEDOP_shutdown        2   /* Stop executing this domain.        */
-#define SCHEDOP_cmdmask       255   /* 8-bit command. */
-#define SCHEDOP_reasonshift     8   /* 8-bit reason code. (SCHEDOP_shutdown) */
-
-/*
- * Commands to HYPERVISOR_console_io().
- */
-#define CONSOLEIO_write         0
-#define CONSOLEIO_read          1
-
-/*
- * Commands to HYPERVISOR_dom_mem_op().
- */
-#define MEMOP_increase_reservation 0
-#define MEMOP_decrease_reservation 1
-
-/*
- * Commands to HYPERVISOR_vm_assist().
- */
-#define VMASST_CMD_enable                0
-#define VMASST_CMD_disable               1
-#define VMASST_TYPE_4gb_segments         0
-#define VMASST_TYPE_4gb_segments_notify  1
-#define VMASST_TYPE_writable_pagetables  2
-#define MAX_VMASST_TYPE 2
-
-#ifndef __ASSEMBLY__
-
-typedef u16 domid_t;
-
-/* Domain ids >= DOMID_FIRST_RESERVED cannot be used for ordinary domains. */
-#define DOMID_FIRST_RESERVED (0x7FF0U)
-
-/* DOMID_SELF is used in certain contexts to refer to oneself. */
-#define DOMID_SELF (0x7FF0U)
-
-/*
- * DOMID_IO is used to restrict page-table updates to mapping I/O memory.
- * Although no Foreign Domain need be specified to map I/O pages, DOMID_IO
- * is useful to ensure that no mappings to the OS's own heap are accidentally
- * installed. (e.g., in Linux this could cause havoc as reference counts
- * aren't adjusted on the I/O-mapping code path).
- * This only makes sense in MMUEXT_SET_FOREIGNDOM, but in that context can
- * be specified by any calling domain.
- */
-#define DOMID_IO   (0x7FF1U)
-
-/*
- * DOMID_XEN is used to allow privileged domains to map restricted parts of
- * Xen's heap space (e.g., the machine_to_phys table).
- * This only makes sense in MMUEXT_SET_FOREIGNDOM, and is only permitted if
- * the caller is privileged.
- */
-#define DOMID_XEN  (0x7FF2U)
-
-/*
- * Send an array of these to HYPERVISOR_mmu_update().
- * NB. The fields are natural pointer/address size for this architecture.
- */
-typedef struct
-{
-    memory_t ptr;    /* Machine address of PTE. */
-    memory_t val;    /* New contents of PTE.    */
-} PACKED mmu_update_t;
-
-/*
- * Send an array of these to HYPERVISOR_multicall().
- * NB. The fields are natural register size for this architecture.
- */
-typedef struct
-{
-    cpureg_t op;
-    cpureg_t args[7];
-} PACKED multicall_entry_t;
-
-/* Event channel endpoints per domain. */
-#define NR_EVENT_CHANNELS 1024
-
-/* No support for multi-processor guests. */
-#define MAX_VIRT_CPUS 1
-
-/*
- * Xen/guestos shared data -- pointer provided in start_info.
- * NB. We expect that this struct is smaller than a page.
- */
-typedef struct shared_info_st
-{
-    /*
-     * Per-VCPU information goes here. This will be cleaned up more when Xen 
-     * actually supports multi-VCPU guests.
-     */
-    struct {
-        /*
-         * 'evtchn_upcall_pending' is written non-zero by Xen to indicate
-         * a pending notification for a particular VCPU. It is then cleared 
-         * by the guest OS /before/ checking for pending work, thus avoiding
-         * a set-and-check race. Note that the mask is only accessed by Xen
-         * on the CPU that is currently hosting the VCPU. This means that the
-         * pending and mask flags can be updated by the guest without special
-         * synchronisation (i.e., no need for the x86 LOCK prefix).
-         * This may seem suboptimal because if the pending flag is set by
-         * a different CPU then an IPI may be scheduled even when the mask
-         * is set. However, note:
-         *  1. The task of 'interrupt holdoff' is covered by the per-event-
-         *     channel mask bits. A 'noisy' event that is continually being
-         *     triggered can be masked at source at this very precise
-         *     granularity.
-         *  2. The main purpose of the per-VCPU mask is therefore to restrict
-         *     reentrant execution: whether for concurrency control, or to
-         *     prevent unbounded stack usage. Whatever the purpose, we expect
-         *     that the mask will be asserted only for short periods at a time,
-         *     and so the likelihood of a 'spurious' IPI is suitably small.
-         * The mask is read before making an event upcall to the guest: a
-         * non-zero mask therefore guarantees that the VCPU will not receive
-         * an upcall activation. The mask is cleared when the VCPU requests
-         * to block: this avoids wakeup-waiting races.
-         */
-        u8 evtchn_upcall_pending;
-        u8 evtchn_upcall_mask;
-        u8 pad0, pad1;
-    } PACKED vcpu_data[MAX_VIRT_CPUS];  /*   0 */
-
-    /*
-     * A domain can have up to 1024 "event channels" on which it can send
-     * and receive asynchronous event notifications. There are three classes
-     * of event that are delivered by this mechanism:
-     *  1. Bi-directional inter- and intra-domain connections. Domains must
-     *     arrange out-of-band to set up a connection (usually the setup
-     *     is initiated and organised by a privileged third party such as
-     *     software running in domain 0).
-     *  2. Physical interrupts. A domain with suitable hardware-access
-     *     privileges can bind an event-channel port to a physical interrupt
-     *     source.
-     *  3. Virtual interrupts ('events'). A domain can bind an event-channel
-     *     port to a virtual interrupt source, such as the virtual-timer
-     *     device or the emergency console.
-     * 
-     * Event channels are addressed by a "port index" between 0 and 1023.
-     * Each channel is associated with two bits of information:
-     *  1. PENDING -- notifies the domain that there is a pending notification
-     *     to be processed. This bit is cleared by the guest.
-     *  2. MASK -- if this bit is clear then a 0->1 transition of PENDING
-     *     will cause an asynchronous upcall to be scheduled. This bit is only
-     *     updated by the guest. It is read-only within Xen. If a channel
-     *     becomes pending while the channel is masked then the 'edge' is lost
-     *     (i.e., when the channel is unmasked, the guest must manually handle
-     *     pending notifications as no upcall will be scheduled by Xen).
-     * 
-     * To expedite scanning of pending notifications, any 0->1 pending
-     * transition on an unmasked channel causes a corresponding bit in a
-     * 32-bit selector to be set. Each bit in the selector covers a 32-bit
-     * word in the PENDING bitfield array.
-     */
-    u32 evtchn_pending[32];             /*   4 */
-    u32 evtchn_pending_sel;             /* 132 */
-    u32 evtchn_mask[32];                /* 136 */
-
-    /*
-     * Time: The following abstractions are exposed: System Time, Clock Time,
-     * Domain Virtual Time. Domains can access Cycle counter time directly.
-     */
-    u64                cpu_freq;        /* 264: CPU frequency (Hz).          */
-
-    /*
-     * The following values are updated periodically (and not necessarily
-     * atomically!). The guest OS detects this because 'time_version1' is
-     * incremented just before updating these values, and 'time_version2' is
-     * incremented immediately after. See the Xen-specific Linux code for an
-     * example of how to read these values safely (arch/xen/kernel/time.c).
-     */
-    u32                time_version1;   /* 272 */
-    u32                time_version2;   /* 276 */
-    tsc_timestamp_t    tsc_timestamp;   /* TSC at last update of time vals.  */
-    u64                system_time;     /* Time, in nanosecs, since boot.    */
-    u32                wc_sec;          /* Secs  00:00:00 UTC, Jan 1, 1970.  */
-    u32                wc_usec;         /* Usecs 00:00:00 UTC, Jan 1, 1970.  */
-    u64                domain_time;     /* Domain virtual time, in nanosecs. */
-
-    /*
-     * Timeout values:
-     * Allow a domain to specify a timeout value in system time and 
-     * domain virtual time.
-     */
-    u64                wall_timeout;    /* 312 */
-    u64                domain_timeout;  /* 320 */
-
-    arch_shared_info_t arch;
-
-} PACKED shared_info_t;
-
-/*
- * Start-of-day memory layout for the initial domain (DOM0):
- *  1. The domain is started within contiguous virtual-memory region.
- *  2. The contiguous region begins and ends on an aligned 4MB boundary.
- *  3. The region start corresponds to the load address of the OS image.
- *     If the load address is not 4MB aligned then the address is rounded down.
- *  4. This the order of bootstrap elements in the initial virtual region:
- *      a. relocated kernel image
- *      b. initial ram disk              [mod_start, mod_len]
- *      c. list of allocated page frames [mfn_list, nr_pages]
- *      d. bootstrap page tables         [pt_base, CR3 (x86)]
- *      e. start_info_t structure        [register ESI (x86)]
- *      f. bootstrap stack               [register ESP (x86)]
- *  5. Bootstrap elements are packed together, but each is 4kB-aligned.
- *  6. The initial ram disk may be omitted.
- *  7. The list of page frames forms a contiguous 'pseudo-physical' memory
- *     layout for the domain. In particular, the bootstrap virtual-memory
- *     region is a 1:1 mapping to the first section of the pseudo-physical map.
- *  8. All bootstrap elements are mapped read-writable for the guest OS. The
- *     only exception is the bootstrap page table, which is mapped read-only.
- *  9. There is guaranteed to be at least 512kB padding after the final
- *     bootstrap element. If necessary, the bootstrap virtual region is
- *     extended by an extra 4MB to ensure this.
- */
-
-#define MAX_CMDLINE 256
-typedef struct {
-    /* THE FOLLOWING ARE FILLED IN BOTH ON INITIAL BOOT AND ON RESUME.     */
-    memory_t nr_pages;        /*  0: Total pages allocated to this domain. */
-    _MEMORY_PADDING(A);
-    memory_t shared_info;     /*  8: MACHINE address of shared info struct.*/
-    _MEMORY_PADDING(B);
-    u32      flags;           /* 16: SIF_xxx flags.                        */
-    u16      domain_controller_evtchn; /* 20 */
-    u16      __pad;
-    /* THE FOLLOWING ARE ONLY FILLED IN ON INITIAL BOOT (NOT RESUME).      */
-    memory_t pt_base;         /* 24: VIRTUAL address of page directory.    */
-    _MEMORY_PADDING(C);
-    memory_t nr_pt_frames;    /* 32: Number of bootstrap p.t. frames.      */
-    _MEMORY_PADDING(D);
-    memory_t mfn_list;        /* 40: VIRTUAL address of page-frame list.   */
-    _MEMORY_PADDING(E);
-    memory_t mod_start;       /* 48: VIRTUAL address of pre-loaded module. */
-    _MEMORY_PADDING(F);
-    memory_t mod_len;         /* 56: Size (bytes) of pre-loaded module.    */
-    _MEMORY_PADDING(G);
-    u8 cmd_line[MAX_CMDLINE]; /* 64 */
-} PACKED start_info_t; /* 320 bytes */
-
-/* These flags are passed in the 'flags' field of start_info_t. */
-#define SIF_PRIVILEGED    (1<<0)  /* Is the domain privileged? */
-#define SIF_INITDOMAIN    (1<<1)  /* Is this the initial control domain? */
-#define SIF_BLK_BE_DOMAIN (1<<4)  /* Is this a block backend domain? */
-#define SIF_NET_BE_DOMAIN (1<<5)  /* Is this a net backend domain? */
-
-/* For use in guest OSes. */
-extern shared_info_t *HYPERVISOR_shared_info;
-
-#endif /* !__ASSEMBLY__ */
-
-#endif /* __HYPERVISOR_IF_H__ */
diff --git a/xen/include/hypervisor-ifs/io/blkif.h b/xen/include/hypervisor-ifs/io/blkif.h
deleted file mode 100644 (file)
index 1024629..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-/******************************************************************************
- * blkif.h
- * 
- * Unified block-device I/O interface for Xen guest OSes.
- * 
- * Copyright (c) 2003-2004, Keir Fraser
- */
-
-#ifndef __SHARED_BLKIF_H__
-#define __SHARED_BLKIF_H__
-
-#define blkif_vdev_t   u16
-#define blkif_sector_t u64
-
-#define BLKIF_OP_READ      0
-#define BLKIF_OP_WRITE     1
-#define BLKIF_OP_PROBE     2
-
-/* NB. Ring size must be small enough for sizeof(blkif_ring_t) <= PAGE_SIZE. */
-#define BLKIF_RING_SIZE        64
-
-/*
- * Maximum scatter/gather segments per request.
- * This is carefully chosen so that sizeof(blkif_ring_t) <= PAGE_SIZE.
- * NB. This could be 12 if the ring indexes weren't stored in the same page.
- */
-#define BLKIF_MAX_SEGMENTS_PER_REQUEST 11
-
-typedef struct {
-    u8             operation;    /*  0: BLKIF_OP_???                         */
-    u8             nr_segments;  /*  1: number of segments                   */
-    blkif_vdev_t   device;       /*  2: only for read/write requests         */
-    unsigned long  id;           /*  4: private guest value, echoed in resp  */
-    blkif_sector_t sector_number;    /* start sector idx on disk (r/w only)  */
-    /* @f_a_s[2:0]=last_sect ; @f_a_s[5:3]=first_sect ; @f_a_s[:12]=frame.   */
-    /* @first_sect: first sector in frame to transfer (inclusive).           */
-    /* @last_sect: last sector in frame to transfer (inclusive).             */
-    /* @frame: machine page frame number.                                    */
-    unsigned long  frame_and_sects[BLKIF_MAX_SEGMENTS_PER_REQUEST];
-} PACKED blkif_request_t;
-
-#define blkif_first_sect(_fas) (((_fas)>>3)&7)
-#define blkif_last_sect(_fas)  ((_fas)&7)
-
-typedef struct {
-    unsigned long   id;              /* copied from request */
-    u8              operation;       /* copied from request */
-    s16             status;          /* BLKIF_RSP_???       */
-} PACKED blkif_response_t;
-
-#define BLKIF_RSP_ERROR  -1 /* non-specific 'error' */
-#define BLKIF_RSP_OKAY    0 /* non-specific 'okay'  */
-
-/*
- * We use a special capitalised type name because it is _essential_ that all 
- * arithmetic on indexes is done on an integer type of the correct size.
- */
-typedef u32 BLKIF_RING_IDX;
-
-/*
- * Ring indexes are 'free running'. That is, they are not stored modulo the
- * size of the ring buffer. The following macro converts a free-running counter
- * into a value that can directly index a ring-buffer array.
- */
-#define MASK_BLKIF_IDX(_i) ((_i)&(BLKIF_RING_SIZE-1))
-
-typedef struct {
-    BLKIF_RING_IDX req_prod;  /*  0: Request producer. Updated by front-end. */
-    BLKIF_RING_IDX resp_prod; /*  4: Response producer. Updated by back-end. */
-    union {                   /*  8 */
-        blkif_request_t  req;
-        blkif_response_t resp;
-    } PACKED ring[BLKIF_RING_SIZE];
-} PACKED blkif_ring_t;
-
-
-/*
- * BLKIF_OP_PROBE:
- * The request format for a probe request is constrained as follows:
- *  @operation   == BLKIF_OP_PROBE
- *  @nr_segments == size of probe buffer in pages
- *  @device      == unused (zero)
- *  @id          == any value (echoed in response message)
- *  @sector_num  == unused (zero)
- *  @frame_and_sects == list of page-sized buffers.
- *                       (i.e., @first_sect == 0, @last_sect == 7).
- * 
- * The response is a list of vdisk_t elements copied into the out-of-band
- * probe buffer. On success the response status field contains the number
- * of vdisk_t elements.
- */
-
-/* XXX SMH: Type values below are chosen to match ide_xxx in Linux ide.h. */
-#define VDISK_TYPE_FLOPPY  0x00
-#define VDISK_TYPE_TAPE    0x01
-#define VDISK_TYPE_CDROM   0x05
-#define VDISK_TYPE_OPTICAL 0x07
-#define VDISK_TYPE_DISK    0x20 
-
-#define VDISK_TYPE_MASK    0x3F
-#define VDISK_TYPE(_x)     ((_x) & VDISK_TYPE_MASK) 
-
-/* The top two bits of the type field encode various flags. */
-#define VDISK_FLAG_RO      0x40
-#define VDISK_FLAG_VIRT    0x80
-#define VDISK_READONLY(_x) ((_x) & VDISK_FLAG_RO)
-#define VDISK_VIRTUAL(_x)  ((_x) & VDISK_FLAG_VIRT) 
-
-typedef struct {
-    blkif_sector_t capacity;     /*  0: Size in terms of 512-byte sectors.   */
-    blkif_vdev_t   device;       /*  8: Device number (opaque 16 bit value). */
-    u16            info;         /* 10: Device type and flags (VDISK_*).     */
-} PACKED vdisk_t; /* 12 bytes */
-
-#endif /* __SHARED_BLKIF_H__ */
diff --git a/xen/include/hypervisor-ifs/io/domain_controller.h b/xen/include/hypervisor-ifs/io/domain_controller.h
deleted file mode 100644 (file)
index ab04072..0000000
+++ /dev/null
@@ -1,578 +0,0 @@
-/******************************************************************************
- * domain_controller.h
- * 
- * Interface to server controller (e.g., 'xend'). This header file defines the 
- * interface that is shared with guest OSes.
- * 
- * Copyright (c) 2004, K A Fraser
- */
-
-#ifndef __DOMAIN_CONTROLLER_H__
-#define __DOMAIN_CONTROLLER_H__
-
-
-/*
- * Reason codes for SCHEDOP_shutdown. These are opaque to Xen but may be
- * interpreted by control software to determine the appropriate action. These 
- * are only really advisories: the controller can actually do as it likes.
- */
-#define SHUTDOWN_poweroff   0  /* Domain exited normally. Clean up and kill. */
-#define SHUTDOWN_reboot     1  /* Clean up, kill, and then restart.          */
-#define SHUTDOWN_suspend    2  /* Clean up, save suspend info, kill.         */
-
-
-/*
- * CONTROLLER MESSAGING INTERFACE.
- */
-
-typedef struct {
-    u8 type;     /*  0: echoed in response */
-    u8 subtype;  /*  1: echoed in response */
-    u8 id;       /*  2: echoed in response */
-    u8 length;   /*  3: number of bytes in 'msg' */
-    u8 msg[60];  /*  4: type-specific message data */
-} PACKED control_msg_t; /* 64 bytes */
-
-#define CONTROL_RING_SIZE 8
-typedef u32 CONTROL_RING_IDX;
-#define MASK_CONTROL_IDX(_i) ((_i)&(CONTROL_RING_SIZE-1))
-
-typedef struct {
-    control_msg_t tx_ring[CONTROL_RING_SIZE];   /*    0: guest -> controller */
-    control_msg_t rx_ring[CONTROL_RING_SIZE];   /*  512: controller -> guest */
-    CONTROL_RING_IDX tx_req_prod, tx_resp_prod; /* 1024, 1028 */
-    CONTROL_RING_IDX rx_req_prod, rx_resp_prod; /* 1032, 1036 */
-} PACKED control_if_t; /* 1040 bytes */
-
-/*
- * Top-level command types.
- */
-#define CMSG_CONSOLE        0  /* Console                 */
-#define CMSG_BLKIF_BE       1  /* Block-device backend    */
-#define CMSG_BLKIF_FE       2  /* Block-device frontend   */
-#define CMSG_NETIF_BE       3  /* Network-device backend  */
-#define CMSG_NETIF_FE       4  /* Network-device frontend */
-#define CMSG_SHUTDOWN       6  /* Shutdown messages       */
-#define CMSG_MEM_REQUEST    7  /* Memory reservation reqs */
-
-
-/******************************************************************************
- * CONSOLE DEFINITIONS
- */
-
-/*
- * Subtypes for console messages.
- */
-#define CMSG_CONSOLE_DATA       0
-
-
-/******************************************************************************
- * BLOCK-INTERFACE FRONTEND DEFINITIONS
- */
-
-/* Messages from domain controller to guest. */
-#define CMSG_BLKIF_FE_INTERFACE_STATUS           0
-
-/* Messages from guest to domain controller. */
-#define CMSG_BLKIF_FE_DRIVER_STATUS             32
-#define CMSG_BLKIF_FE_INTERFACE_CONNECT         33
-#define CMSG_BLKIF_FE_INTERFACE_DISCONNECT      34
-#define CMSG_BLKIF_FE_INTERFACE_QUERY           35
-
-/* These are used by both front-end and back-end drivers. */
-#define blkif_vdev_t   u16
-#define blkif_pdev_t   u16
-#define blkif_sector_t u64
-
-/*
- * CMSG_BLKIF_FE_INTERFACE_STATUS:
- *  Notify a guest about a status change on one of its block interfaces.
- *  If the interface is DESTROYED or DOWN then the interface is disconnected:
- *   1. The shared-memory frame is available for reuse.
- *   2. Any unacknowledged messages pending on the interface were dropped.
- */
-#define BLKIF_INTERFACE_STATUS_CLOSED       0 /* Interface doesn't exist.    */
-#define BLKIF_INTERFACE_STATUS_DISCONNECTED 1 /* Exists but is disconnected. */
-#define BLKIF_INTERFACE_STATUS_CONNECTED    2 /* Exists and is connected.    */
-#define BLKIF_INTERFACE_STATUS_CHANGED      3 /* A device has been added or removed. */
-typedef struct {
-    u32 handle; /*  0 */
-    u32 status; /*  4 */
-    u16 evtchn; /*  8: (only if status == BLKIF_INTERFACE_STATUS_CONNECTED). */
-    domid_t domid; /* 10: status != BLKIF_INTERFACE_STATUS_DESTROYED */
-} PACKED blkif_fe_interface_status_t; /* 12 bytes */
-
-/*
- * CMSG_BLKIF_FE_DRIVER_STATUS:
- *  Notify the domain controller that the front-end driver is DOWN or UP.
- *  When the driver goes DOWN then the controller will send no more
- *  status-change notifications.
- *  If the driver goes DOWN while interfaces are still UP, the domain
- *  will automatically take the interfaces DOWN.
- * 
- *  NB. The controller should not send an INTERFACE_STATUS_CHANGED message
- *  for interfaces that are active when it receives an UP notification. We
- *  expect that the frontend driver will query those interfaces itself.
- */
-#define BLKIF_DRIVER_STATUS_DOWN   0
-#define BLKIF_DRIVER_STATUS_UP     1
-typedef struct {
-    /* IN */
-    u32 status;        /*  0: BLKIF_DRIVER_STATUS_??? */
-    /* OUT */
-    /* Driver should query interfaces [0..max_handle]. */
-    u32 max_handle;    /*  4 */
-} PACKED blkif_fe_driver_status_t; /* 8 bytes */
-
-/*
- * CMSG_BLKIF_FE_INTERFACE_CONNECT:
- *  If successful, the domain controller will acknowledge with a
- *  STATUS_CONNECTED message.
- */
-typedef struct {
-    u32      handle;      /*  0 */
-    u32      __pad;
-    memory_t shmem_frame; /*  8 */
-    MEMORY_PADDING;
-} PACKED blkif_fe_interface_connect_t; /* 16 bytes */
-
-/*
- * CMSG_BLKIF_FE_INTERFACE_DISCONNECT:
- *  If successful, the domain controller will acknowledge with a
- *  STATUS_DISCONNECTED message.
- */
-typedef struct {
-    u32 handle; /*  0 */
-} PACKED blkif_fe_interface_disconnect_t; /* 4 bytes */
-
-/*
- * CMSG_BLKIF_FE_INTERFACE_QUERY:
- */
-typedef struct {
-    /* IN */
-    u32 handle; /*  0 */
-    /* OUT */
-    u32 status; /*  4 */
-    u16 evtchn; /*  8: (only if status == BLKIF_INTERFACE_STATUS_CONNECTED). */
-    domid_t domid; /* 10: status != BLKIF_INTERFACE_STATUS_DESTROYED */
-} PACKED blkif_fe_interface_query_t; /* 12 bytes */
-
-
-/******************************************************************************
- * BLOCK-INTERFACE BACKEND DEFINITIONS
- */
-
-/* Messages from domain controller. */
-#define CMSG_BLKIF_BE_CREATE      0  /* Create a new block-device interface. */
-#define CMSG_BLKIF_BE_DESTROY     1  /* Destroy a block-device interface.    */
-#define CMSG_BLKIF_BE_CONNECT     2  /* Connect i/f to remote driver.        */
-#define CMSG_BLKIF_BE_DISCONNECT  3  /* Disconnect i/f from remote driver.   */
-#define CMSG_BLKIF_BE_VBD_CREATE  4  /* Create a new VBD for an interface.   */
-#define CMSG_BLKIF_BE_VBD_DESTROY 5  /* Delete a VBD from an interface.      */
-#define CMSG_BLKIF_BE_VBD_GROW    6  /* Append an extent to a given VBD.     */
-#define CMSG_BLKIF_BE_VBD_SHRINK  7  /* Remove last extent from a given VBD. */
-
-/* Messages to domain controller. */
-#define CMSG_BLKIF_BE_DRIVER_STATUS 32
-
-/*
- * Message request/response definitions for block-device messages.
- */
-
-typedef struct {
-    blkif_sector_t sector_start;   /*  0 */
-    blkif_sector_t sector_length;  /*  8 */
-    blkif_pdev_t   device;         /* 16 */
-    u16            __pad;          /* 18 */
-} PACKED blkif_extent_t; /* 20 bytes */
-
-/* Non-specific 'okay' return. */
-#define BLKIF_BE_STATUS_OKAY                0
-/* Non-specific 'error' return. */
-#define BLKIF_BE_STATUS_ERROR               1
-/* The following are specific error returns. */
-#define BLKIF_BE_STATUS_INTERFACE_EXISTS    2
-#define BLKIF_BE_STATUS_INTERFACE_NOT_FOUND 3
-#define BLKIF_BE_STATUS_INTERFACE_CONNECTED 4
-#define BLKIF_BE_STATUS_VBD_EXISTS          5
-#define BLKIF_BE_STATUS_VBD_NOT_FOUND       6
-#define BLKIF_BE_STATUS_OUT_OF_MEMORY       7
-#define BLKIF_BE_STATUS_EXTENT_NOT_FOUND    8
-#define BLKIF_BE_STATUS_MAPPING_ERROR       9
-
-/* This macro can be used to create an array of descriptive error strings. */
-#define BLKIF_BE_STATUS_ERRORS {    \
-    "Okay",                         \
-    "Non-specific error",           \
-    "Interface already exists",     \
-    "Interface not found",          \
-    "Interface is still connected", \
-    "VBD already exists",           \
-    "VBD not found",                \
-    "Out of memory",                \
-    "Extent not found for VBD",     \
-    "Could not map domain memory" }
-
-/*
- * CMSG_BLKIF_BE_CREATE:
- *  When the driver sends a successful response then the interface is fully
- *  created. The controller will send a DOWN notification to the front-end
- *  driver.
- */
-typedef struct { 
-    /* IN */
-    domid_t    domid;         /*  0: Domain attached to new interface.   */
-    u16        __pad;
-    u32        blkif_handle;  /*  4: Domain-specific interface handle.   */
-    /* OUT */
-    u32        status;        /*  8 */
-} PACKED blkif_be_create_t; /* 12 bytes */
-
-/*
- * CMSG_BLKIF_BE_DESTROY:
- *  When the driver sends a successful response then the interface is fully
- *  torn down. The controller will send a DESTROYED notification to the
- *  front-end driver.
- */
-typedef struct { 
-    /* IN */
-    domid_t    domid;         /*  0: Identify interface to be destroyed. */
-    u16        __pad;
-    u32        blkif_handle;  /*  4: ...ditto...                         */
-    /* OUT */
-    u32        status;        /*  8 */
-} PACKED blkif_be_destroy_t; /* 12 bytes */
-
-/*
- * CMSG_BLKIF_BE_CONNECT:
- *  When the driver sends a successful response then the interface is fully
- *  connected. The controller will send a CONNECTED notification to the
- *  front-end driver.
- */
-typedef struct { 
-    /* IN */
-    domid_t    domid;         /*  0: Domain attached to new interface.   */
-    u16        __pad;
-    u32        blkif_handle;  /*  4: Domain-specific interface handle.   */
-    memory_t   shmem_frame;   /*  8: Page cont. shared comms window.     */
-    MEMORY_PADDING;
-    u32        evtchn;        /* 16: Event channel for notifications.    */
-    /* OUT */
-    u32        status;        /* 20 */
-} PACKED blkif_be_connect_t;  /* 24 bytes */
-
-/*
- * CMSG_BLKIF_BE_DISCONNECT:
- *  When the driver sends a successful response then the interface is fully
- *  disconnected. The controller will send a DOWN notification to the front-end
- *  driver.
- */
-typedef struct { 
-    /* IN */
-    domid_t    domid;         /*  0: Domain attached to new interface.   */
-    u16        __pad;
-    u32        blkif_handle;  /*  4: Domain-specific interface handle.   */
-    /* OUT */
-    u32        status;        /*  8 */
-} PACKED blkif_be_disconnect_t; /* 12 bytes */
-
-/* CMSG_BLKIF_BE_VBD_CREATE */
-typedef struct { 
-    /* IN */
-    domid_t    domid;         /*  0: Identify blkdev interface.          */
-    u16        __pad;
-    u32        blkif_handle;  /*  4: ...ditto...                         */
-    blkif_vdev_t vdevice;     /*  8: Interface-specific id for this VBD. */
-    u16        readonly;      /* 10: Non-zero -> VBD isn't writable.     */
-    /* OUT */
-    u32        status;        /* 12 */
-} PACKED blkif_be_vbd_create_t; /* 16 bytes */
-
-/* CMSG_BLKIF_BE_VBD_DESTROY */
-typedef struct {
-    /* IN */
-    domid_t    domid;         /*  0: Identify blkdev interface.          */
-    u16        __pad0;        /*  2 */
-    u32        blkif_handle;  /*  4: ...ditto...                         */
-    blkif_vdev_t vdevice;     /*  8: Interface-specific id of the VBD.   */
-    u16        __pad1;        /* 10 */
-    /* OUT */
-    u32        status;        /* 12 */
-} PACKED blkif_be_vbd_destroy_t; /* 16 bytes */
-
-/* CMSG_BLKIF_BE_VBD_GROW */
-typedef struct { 
-    /* IN */
-    domid_t    domid;         /*  0: Identify blkdev interface.          */
-    u16        __pad0;        /*  2 */
-    u32        blkif_handle;  /*  4: ...ditto...                         */
-    blkif_extent_t extent;    /*  8: Physical extent to append to VBD.   */
-    blkif_vdev_t vdevice;     /* 28: Interface-specific id of the VBD.   */
-    u16        __pad1;        /* 30 */
-    /* OUT */
-    u32        status;        /* 32 */
-} PACKED blkif_be_vbd_grow_t; /* 36 bytes */
-
-/* CMSG_BLKIF_BE_VBD_SHRINK */
-typedef struct { 
-    /* IN */
-    domid_t    domid;         /*  0: Identify blkdev interface.          */
-    u16        __pad0;        /*  2 */
-    u32        blkif_handle;  /*  4: ...ditto...                         */
-    blkif_vdev_t vdevice;     /*  8: Interface-specific id of the VBD.   */
-    u16        __pad1;        /* 10 */
-    /* OUT */
-    u32        status;        /* 12 */
-} PACKED blkif_be_vbd_shrink_t; /* 16 bytes */
-
-/*
- * CMSG_BLKIF_BE_DRIVER_STATUS:
- *  Notify the domain controller that the back-end driver is DOWN or UP.
- *  If the driver goes DOWN while interfaces are still UP, the controller
- *  will automatically send DOWN notifications.
- */
-typedef struct {
-    u32        status;        /*  0: BLKIF_DRIVER_STATUS_??? */
-} PACKED blkif_be_driver_status_t; /* 4 bytes */
-
-
-/******************************************************************************
- * NETWORK-INTERFACE FRONTEND DEFINITIONS
- */
-
-/* Messages from domain controller to guest. */
-#define CMSG_NETIF_FE_INTERFACE_STATUS   0
-
-/* Messages from guest to domain controller. */
-#define CMSG_NETIF_FE_DRIVER_STATUS             32
-#define CMSG_NETIF_FE_INTERFACE_CONNECT         33
-#define CMSG_NETIF_FE_INTERFACE_DISCONNECT      34
-#define CMSG_NETIF_FE_INTERFACE_QUERY           35
-
-/*
- * CMSG_NETIF_FE_INTERFACE_STATUS:
- *  Notify a guest about a status change on one of its network interfaces.
- *  If the interface is CLOSED or DOWN then the interface is disconnected:
- *   1. The shared-memory frame is available for reuse.
- *   2. Any unacknowledged messgaes pending on the interface were dropped.
- */
-#define NETIF_INTERFACE_STATUS_CLOSED       0 /* Interface doesn't exist.    */
-#define NETIF_INTERFACE_STATUS_DISCONNECTED 1 /* Exists but is disconnected. */
-#define NETIF_INTERFACE_STATUS_CONNECTED    2 /* Exists and is connected.    */
-#define NETIF_INTERFACE_STATUS_CHANGED      3 /* A device has been added or removed. */
-typedef struct {
-    u32        handle; /*  0 */
-    u32        status; /*  4 */
-    u16        evtchn; /*  8: status == NETIF_INTERFACE_STATUS_CONNECTED */
-    u8         mac[6]; /* 10: status == NETIF_INTERFACE_STATUS_CONNECTED */
-    domid_t    domid;  /* 16: status != NETIF_INTERFACE_STATUS_DESTROYED */
-} PACKED netif_fe_interface_status_t; /* 18 bytes */
-
-/*
- * CMSG_NETIF_FE_DRIVER_STATUS:
- *  Notify the domain controller that the front-end driver is DOWN or UP.
- *  When the driver goes DOWN then the controller will send no more
- *  status-change notifications.
- *  If the driver goes DOWN while interfaces are still UP, the domain
- *  will automatically take the interfaces DOWN.
- * 
- *  NB. The controller should not send an INTERFACE_STATUS message
- *  for interfaces that are active when it receives an UP notification. We
- *  expect that the frontend driver will query those interfaces itself.
- */
-#define NETIF_DRIVER_STATUS_DOWN   0
-#define NETIF_DRIVER_STATUS_UP     1
-typedef struct {
-    /* IN */
-    u32        status;        /*  0: NETIF_DRIVER_STATUS_??? */
-    /* OUT */
-    /* Driver should query interfaces [0..max_handle]. */
-    u32        max_handle;    /*  4 */
-} PACKED netif_fe_driver_status_t; /* 8 bytes */
-
-/*
- * CMSG_NETIF_FE_INTERFACE_CONNECT:
- *  If successful, the domain controller will acknowledge with a
- *  STATUS_CONNECTED message.
- */
-typedef struct {
-    u32        handle;         /*  0 */
-    u32        __pad;          /*  4 */
-    memory_t   tx_shmem_frame; /*  8 */
-    MEMORY_PADDING;
-    memory_t   rx_shmem_frame; /* 16 */
-    MEMORY_PADDING;
-} PACKED netif_fe_interface_connect_t; /* 24 bytes */
-
-/*
- * CMSG_NETIF_FE_INTERFACE_DISCONNECT:
- *  If successful, the domain controller will acknowledge with a
- *  STATUS_DISCONNECTED message.
- */
-typedef struct {
-    u32        handle;        /*  0 */
-} PACKED netif_fe_interface_disconnect_t; /* 4 bytes */
-
-/*
- * CMSG_NETIF_FE_INTERFACE_QUERY:
- */
-typedef struct {
-    /* IN */
-    u32        handle; /*  0 */
-    /* OUT */
-    u32        status; /*  4 */
-    u16        evtchn; /*  8: status == NETIF_INTERFACE_STATUS_CONNECTED */
-    u8         mac[6]; /* 10: status == NETIF_INTERFACE_STATUS_CONNECTED */
-    domid_t    domid;  /* 16: status != NETIF_INTERFACE_STATUS_DESTROYED */
-} PACKED netif_fe_interface_query_t; /* 18 bytes */
-
-
-/******************************************************************************
- * NETWORK-INTERFACE BACKEND DEFINITIONS
- */
-
-/* Messages from domain controller. */
-#define CMSG_NETIF_BE_CREATE      0  /* Create a new net-device interface. */
-#define CMSG_NETIF_BE_DESTROY     1  /* Destroy a net-device interface.    */
-#define CMSG_NETIF_BE_CONNECT     2  /* Connect i/f to remote driver.        */
-#define CMSG_NETIF_BE_DISCONNECT  3  /* Disconnect i/f from remote driver.   */
-
-/* Messages to domain controller. */
-#define CMSG_NETIF_BE_DRIVER_STATUS 32
-
-/*
- * Message request/response definitions for net-device messages.
- */
-
-/* Non-specific 'okay' return. */
-#define NETIF_BE_STATUS_OKAY                0
-/* Non-specific 'error' return. */
-#define NETIF_BE_STATUS_ERROR               1
-/* The following are specific error returns. */
-#define NETIF_BE_STATUS_INTERFACE_EXISTS    2
-#define NETIF_BE_STATUS_INTERFACE_NOT_FOUND 3
-#define NETIF_BE_STATUS_INTERFACE_CONNECTED 4
-#define NETIF_BE_STATUS_OUT_OF_MEMORY       5
-#define NETIF_BE_STATUS_MAPPING_ERROR       6
-
-/* This macro can be used to create an array of descriptive error strings. */
-#define NETIF_BE_STATUS_ERRORS {    \
-    "Okay",                         \
-    "Non-specific error",           \
-    "Interface already exists",     \
-    "Interface not found",          \
-    "Interface is still connected", \
-    "Out of memory",                \
-    "Could not map domain memory" }
-
-/*
- * CMSG_NETIF_BE_CREATE:
- *  When the driver sends a successful response then the interface is fully
- *  created. The controller will send a DOWN notification to the front-end
- *  driver.
- */
-typedef struct { 
-    /* IN */
-    domid_t    domid;         /*  0: Domain attached to new interface.   */
-    u16        __pad0;        /*  2 */
-    u32        netif_handle;  /*  4: Domain-specific interface handle.   */
-    u8         mac[6];        /*  8 */
-    u16        __pad1;        /* 14 */
-    /* OUT */
-    u32        status;        /* 16 */
-} PACKED netif_be_create_t; /* 20 bytes */
-
-/*
- * CMSG_NETIF_BE_DESTROY:
- *  When the driver sends a successful response then the interface is fully
- *  torn down. The controller will send a DESTROYED notification to the
- *  front-end driver.
- */
-typedef struct { 
-    /* IN */
-    domid_t    domid;         /*  0: Identify interface to be destroyed. */
-    u16        __pad;
-    u32        netif_handle;  /*  4: ...ditto...                         */
-    /* OUT */
-    u32   status;             /*  8 */
-} PACKED netif_be_destroy_t; /* 12 bytes */
-
-/*
- * CMSG_NETIF_BE_CONNECT:
- *  When the driver sends a successful response then the interface is fully
- *  connected. The controller will send a CONNECTED notification to the
- *  front-end driver.
- */
-typedef struct { 
-    /* IN */
-    domid_t    domid;          /*  0: Domain attached to new interface.   */
-    u16        __pad0;         /*  2 */
-    u32        netif_handle;   /*  4: Domain-specific interface handle.   */
-    memory_t   tx_shmem_frame; /*  8: Page cont. tx shared comms window.  */
-    MEMORY_PADDING;
-    memory_t   rx_shmem_frame; /* 16: Page cont. rx shared comms window.  */
-    MEMORY_PADDING;
-    u16        evtchn;         /* 24: Event channel for notifications.    */
-    u16        __pad1;         /* 26 */
-    /* OUT */
-    u32        status;         /* 28 */
-} PACKED netif_be_connect_t; /* 32 bytes */
-
-/*
- * CMSG_NETIF_BE_DISCONNECT:
- *  When the driver sends a successful response then the interface is fully
- *  disconnected. The controller will send a DOWN notification to the front-end
- *  driver.
- */
-typedef struct { 
-    /* IN */
-    domid_t    domid;         /*  0: Domain attached to new interface.   */
-    u16        __pad;
-    u32        netif_handle;  /*  4: Domain-specific interface handle.   */
-    /* OUT */
-    u32        status;        /*  8 */
-} PACKED netif_be_disconnect_t; /* 12 bytes */
-
-/*
- * CMSG_NETIF_BE_DRIVER_STATUS:
- *  Notify the domain controller that the back-end driver is DOWN or UP.
- *  If the driver goes DOWN while interfaces are still UP, the domain
- *  will automatically send DOWN notifications.
- */
-typedef struct {
-    u32        status;        /*  0: NETIF_DRIVER_STATUS_??? */
-} PACKED netif_be_driver_status_t; /* 4 bytes */
-
-
-/******************************************************************************
- * SHUTDOWN DEFINITIONS
- */
-
-/*
- * Subtypes for shutdown messages.
- */
-#define CMSG_SHUTDOWN_POWEROFF  0   /* Clean shutdown (SHUTDOWN_poweroff).   */
-#define CMSG_SHUTDOWN_REBOOT    1   /* Clean shutdown (SHUTDOWN_reboot).     */
-#define CMSG_SHUTDOWN_SUSPEND   2   /* Create suspend info, then             */
-                                    /* SHUTDOWN_suspend.                     */
-
-
-/******************************************************************************
- * MEMORY CONTROLS
- */
-
-#define CMSG_MEM_REQUEST_SET 0 /* Request a domain to set its mem footprint. */
-
-/*
- * CMSG_MEM_REQUEST:
- *  Request that the domain change its memory reservation.
- */
-typedef struct {
-    /* OUT */
-    u32 target;       /* 0: Target memory reservation in pages.       */
-    /* IN  */
-    u32 status;       /* 4: Return code indicates success or failure. */
-} PACKED mem_request_t; /* 8 bytes */
-
-
-#endif /* __DOMAIN_CONTROLLER_H__ */
diff --git a/xen/include/hypervisor-ifs/io/netif.h b/xen/include/hypervisor-ifs/io/netif.h
deleted file mode 100644 (file)
index abb87ba..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-/******************************************************************************
- * netif.h
- * 
- * Unified network-device I/O interface for Xen guest OSes.
- * 
- * Copyright (c) 2003-2004, Keir Fraser
- */
-
-#ifndef __SHARED_NETIF_H__
-#define __SHARED_NETIF_H__
-
-typedef struct {
-    memory_t addr;   /*  0: Machine address of packet.  */
-    MEMORY_PADDING;
-    u16      id;     /*  8: Echoed in response message. */
-    u16      size;   /* 10: Packet size in bytes.       */
-} PACKED netif_tx_request_t; /* 12 bytes */
-
-typedef struct {
-    u16      id;     /*  0 */
-    s8       status; /*  2 */
-    u8       __pad;  /*  3 */
-} PACKED netif_tx_response_t; /* 4 bytes */
-
-typedef struct {
-    u16       id;    /*  0: Echoed in response message.        */
-} PACKED netif_rx_request_t; /* 2 bytes */
-
-typedef struct {
-    memory_t addr;   /*  0: Machine address of packet.              */
-    MEMORY_PADDING;
-    u16      id;     /*  8:  */
-    s16      status; /* 10: -ve: BLKIF_RSP_* ; +ve: Rx'ed pkt size. */
-} PACKED netif_rx_response_t; /* 12 bytes */
-
-/*
- * We use a special capitalised type name because it is _essential_ that all 
- * arithmetic on indexes is done on an integer type of the correct size.
- */
-typedef u32 NETIF_RING_IDX;
-
-/*
- * Ring indexes are 'free running'. That is, they are not stored modulo the
- * size of the ring buffer. The following macros convert a free-running counter
- * into a value that can directly index a ring-buffer array.
- */
-#define MASK_NETIF_RX_IDX(_i) ((_i)&(NETIF_RX_RING_SIZE-1))
-#define MASK_NETIF_TX_IDX(_i) ((_i)&(NETIF_TX_RING_SIZE-1))
-
-#define NETIF_TX_RING_SIZE 256
-#define NETIF_RX_RING_SIZE 256
-
-/* This structure must fit in a memory page. */
-typedef struct {
-    /*
-     * Frontend places packets into ring at tx_req_prod.
-     * Frontend receives event when tx_resp_prod passes tx_event.
-     * 'req_cons' is a shadow of the backend's request consumer -- the frontend
-     * may use it to determine if all queued packets have been seen by the
-     * backend.
-     */
-    NETIF_RING_IDX req_prod;       /*  0 */
-    NETIF_RING_IDX req_cons;       /*  4 */
-    NETIF_RING_IDX resp_prod;      /*  8 */
-    NETIF_RING_IDX event;          /* 12 */
-    union {                        /* 16 */
-        netif_tx_request_t  req;
-        netif_tx_response_t resp;
-    } PACKED ring[NETIF_TX_RING_SIZE];
-} PACKED netif_tx_interface_t;
-
-/* This structure must fit in a memory page. */
-typedef struct {
-    /*
-     * Frontend places empty buffers into ring at rx_req_prod.
-     * Frontend receives event when rx_resp_prod passes rx_event.
-     */
-    NETIF_RING_IDX req_prod;       /*  0 */
-    NETIF_RING_IDX resp_prod;      /*  4 */
-    NETIF_RING_IDX event;          /*  8 */
-    union {                        /* 12 */
-        netif_rx_request_t  req;
-        netif_rx_response_t resp;
-    } PACKED ring[NETIF_RX_RING_SIZE];
-} PACKED netif_rx_interface_t;
-
-/* Descriptor status values */
-#define NETIF_RSP_DROPPED         -2
-#define NETIF_RSP_ERROR           -1
-#define NETIF_RSP_OKAY             0
-
-#endif
diff --git a/xen/include/hypervisor-ifs/physdev.h b/xen/include/hypervisor-ifs/physdev.h
deleted file mode 100644 (file)
index 4e1aa13..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/* -*-  Mode:C; c-basic-offset:4; tab-width:4 -*-
- ****************************************************************************
- * (c) 2004 - Rolf Neugebauer - Intel Research Cambridge
- * (c) 2004 - Keir Fraser - University of Cambridge
- ****************************************************************************
- * Description: Interface for domains to access physical devices on the PCI bus
- */
-
-#ifndef __HYPERVISOR_IFS_PHYSDEV_H__
-#define __HYPERVISOR_IFS_PHYSDEV_H__
-
-/* Commands to HYPERVISOR_physdev_op() */
-#define PHYSDEVOP_PCI_CFGREG_READ       0
-#define PHYSDEVOP_PCI_CFGREG_WRITE      1
-#define PHYSDEVOP_PCI_INITIALISE_DEVICE 2
-#define PHYSDEVOP_PCI_PROBE_ROOT_BUSES  3
-#define PHYSDEVOP_IRQ_UNMASK_NOTIFY     4
-#define PHYSDEVOP_IRQ_STATUS_QUERY      5
-
-/* Read from PCI configuration space. */
-typedef struct {
-    /* IN */
-    u32 bus;                          /*  0 */
-    u32 dev;                          /*  4 */
-    u32 func;                         /*  8 */
-    u32 reg;                          /* 12 */
-    u32 len;                          /* 16 */
-    /* OUT */
-    u32 value;                        /* 20 */
-} PACKED physdevop_pci_cfgreg_read_t; /* 24 bytes */
-
-/* Write to PCI configuration space. */
-typedef struct {
-    /* IN */
-    u32 bus;                          /*  0 */
-    u32 dev;                          /*  4 */
-    u32 func;                         /*  8 */
-    u32 reg;                          /* 12 */
-    u32 len;                          /* 16 */
-    u32 value;                        /* 20 */
-} PACKED physdevop_pci_cfgreg_write_t; /* 24 bytes */
-
-/* Do final initialisation of a PCI device (e.g., last-moment IRQ routing). */
-typedef struct {
-    /* IN */
-    u32 bus;                          /*  0 */
-    u32 dev;                          /*  4 */
-    u32 func;                         /*  8 */
-} PACKED physdevop_pci_initialise_device_t; /* 12 bytes */
-
-/* Find the root buses for subsequent scanning. */
-typedef struct {
-    /* OUT */
-    u32 busmask[256/32];              /*  0 */
-} PACKED physdevop_pci_probe_root_buses_t; /* 32 bytes */
-
-typedef struct {
-    /* IN */
-    u32 irq;                          /*  0 */
-    /* OUT */
-/* Need to call PHYSDEVOP_IRQ_UNMASK_NOTIFY when the IRQ has been serviced? */
-#define PHYSDEVOP_IRQ_NEEDS_UNMASK_NOTIFY (1<<0)
-    u32 flags;                        /*  4 */
-} PACKED physdevop_irq_status_query_t; /* 8 bytes */
-
-typedef struct _physdev_op_st 
-{
-    u32 cmd;                          /*  0 */
-    u32 __pad;                        /*  4 */
-    union {                           /*  8 */
-        physdevop_pci_cfgreg_read_t       pci_cfgreg_read;
-        physdevop_pci_cfgreg_write_t      pci_cfgreg_write;
-        physdevop_pci_initialise_device_t pci_initialise_device;
-        physdevop_pci_probe_root_buses_t  pci_probe_root_buses;
-        physdevop_irq_status_query_t      irq_status_query;
-        u8                                __dummy[32];
-    } PACKED u;
-} PACKED physdev_op_t; /* 40 bytes */
-
-#endif /* __HYPERVISOR_IFS_PHYSDEV_H__ */
diff --git a/xen/include/hypervisor-ifs/sched_ctl.h b/xen/include/hypervisor-ifs/sched_ctl.h
deleted file mode 100644 (file)
index 0c298f7..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/**
- * Generic scheduler control interface.
- *
- * Mark Williamson, (C) 2004 Intel Research Cambridge
- */
-
-#ifndef __SCHED_CTL_H__
-#define __SCHED_CTL_H__
-
-/* Scheduler types */
-#define SCHED_BVT      0
-#define SCHED_ATROPOS  2
-#define SCHED_RROBIN   3
-
-/* these describe the intended direction used for a scheduler control or domain
- * command */
-#define SCHED_INFO_PUT 0
-#define SCHED_INFO_GET 1
-
-/*
- * Generic scheduler control command - used to adjust system-wide scheduler
- * parameters
- */
-struct sched_ctl_cmd
-{
-    u32 sched_id;                     /*  0 */
-    u32 direction;                    /*  4 */
-    union {                           /*  8 */
-        struct bvt_ctl
-        {
-            /* IN variables. */
-            u32 ctx_allow;            /*  8: context switch allowance */
-        } PACKED bvt;
-
-        struct rrobin_ctl
-        {
-            /* IN variables */
-            u64 slice;                /*  8: round robin time slice */
-        } PACKED rrobin;
-    } PACKED u;
-} PACKED; /* 16 bytes */
-
-struct sched_adjdom_cmd
-{
-    u32     sched_id;                 /*  0 */
-    u32     direction;                /*  4 */
-    domid_t domain;                   /*  8 */
-    u16     __pad0;
-    u32     __pad1;
-    union {                           /* 16 */
-        struct bvt_adjdom
-        {
-            u32 mcu_adv;            /* 16: mcu advance: inverse of weight */
-            u32 warpback;           /* 20: warp? */
-            s32 warpvalue;          /* 24: warp value */
-            long long warpl;        /* 32: warp limit */
-            long long warpu;        /* 40: unwarp time requirement */
-        } PACKED bvt;
-
-        struct atropos_adjdom
-        {
-            u64 nat_period; /* 16 */
-            u64 nat_slice;  /* 24 */
-            u64 latency;    /* 32 */
-            u32 xtratime;   /* 36 */
-        } PACKED atropos;
-    } PACKED u;
-} PACKED; /* 40 bytes */
-
-#endif /* __SCHED_CTL_H__ */
diff --git a/xen/include/hypervisor-ifs/trace.h b/xen/include/hypervisor-ifs/trace.h
deleted file mode 100644 (file)
index 52d5384..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/******************************************************************************
- * include/hypervisor-ifs/trace.h
- */
-
-#ifndef __HYPERVISOR_IFS_TRACE_H__
-#define __HYPERVISOR_IFS_TRACE_H__
-
-/* This structure represents a single trace buffer record. */
-struct t_rec {
-    u64 cycles;               /* 64 bit cycle counter timestamp */
-    u32 event;                /* 32 bit event ID                */
-    u32 d1, d2, d3, d4, d5;   /* event data items               */
-};
-
-/*
- * This structure contains the metadata for a single trace buffer.  The head
- * field, indexes into an array of struct t_rec's.
- */
-struct t_buf {
-    unsigned long data;      /* pointer to data area.  machine address
-                              * for convenience in user space code           */
-
-    unsigned long size;      /* size of the data area, in t_recs             */
-    unsigned long head;      /* array index of the most recent record        */
-
-    /* Xen-private elements follow... */
-    struct t_rec *head_ptr; /* pointer to the head record                    */
-    struct t_rec *vdata;    /* virtual address pointer to data               */
-};
-
-#endif /* __HYPERVISOR_IFS_TRACE_H__ */
diff --git a/xen/include/public/COPYING b/xen/include/public/COPYING
new file mode 100644 (file)
index 0000000..3377710
--- /dev/null
@@ -0,0 +1,28 @@
+XEN NOTICE
+==========
+
+This copyright applies to all files within this subdirectory. All
+other files in the Xen source distribution are covered by version 2 of
+the GNU General Public License.
+
+ -- Keir Fraser (on behalf of the Xen team)
+
+=====================================================================
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
+DEALINGS IN THE SOFTWARE.
diff --git a/xen/include/public/arch-x86_32.h b/xen/include/public/arch-x86_32.h
new file mode 100644 (file)
index 0000000..1287cdb
--- /dev/null
@@ -0,0 +1,141 @@
+/******************************************************************************
+ * arch-x86_32.h
+ * 
+ * Guest OS interface to x86 32-bit Xen.
+ */
+
+#ifndef __XEN_PUBLIC_ARCH_X86_32_H__
+#define __XEN_PUBLIC_ARCH_X86_32_H__
+
+/*
+ * Pointers and other address fields inside interface structures are padded to
+ * 64 bits. This means that field alignments aren't different between 32- and
+ * 64-bit architectures. 
+ */
+/* NB. Multi-level macro ensures __LINE__ is expanded before concatenation. */
+#define __MEMORY_PADDING(_X) u32 __pad_ ## _X
+#define _MEMORY_PADDING(_X)  __MEMORY_PADDING(_X)
+#define MEMORY_PADDING       _MEMORY_PADDING(__LINE__)
+
+/*
+ * SEGMENT DESCRIPTOR TABLES
+ */
+/*
+ * A number of GDT entries are reserved by Xen. These are not situated at the
+ * start of the GDT because some stupid OSes export hard-coded selector values
+ * in their ABI. These hard-coded values are always near the start of the GDT,
+ * so Xen places itself out of the way.
+ * 
+ * NB. The reserved range is inclusive (that is, both FIRST_RESERVED_GDT_ENTRY
+ * and LAST_RESERVED_GDT_ENTRY are reserved).
+ */
+#define NR_RESERVED_GDT_ENTRIES    40
+#define FIRST_RESERVED_GDT_ENTRY   256
+#define LAST_RESERVED_GDT_ENTRY    \
+  (FIRST_RESERVED_GDT_ENTRY + NR_RESERVED_GDT_ENTRIES - 1)
+
+
+/*
+ * These flat segments are in the Xen-private section of every GDT. Since these
+ * are also present in the initial GDT, many OSes will be able to avoid
+ * installing their own GDT.
+ */
+#define FLAT_RING1_CS 0x0819    /* GDT index 259 */
+#define FLAT_RING1_DS 0x0821    /* GDT index 260 */
+#define FLAT_RING3_CS 0x082b    /* GDT index 261 */
+#define FLAT_RING3_DS 0x0833    /* GDT index 262 */
+
+#define FLAT_GUESTOS_CS FLAT_RING1_CS
+#define FLAT_GUESTOS_DS FLAT_RING1_DS
+#define FLAT_USER_CS    FLAT_RING3_CS
+#define FLAT_USER_DS    FLAT_RING3_DS
+
+/* And the trap vector is... */
+#define TRAP_INSTR "int $0x82"
+
+
+/*
+ * Virtual addresses beyond this are not modifiable by guest OSes. The 
+ * machine->physical mapping table starts at this address, read-only.
+ */
+#define HYPERVISOR_VIRT_START (0xFC000000UL)
+#ifndef machine_to_phys_mapping
+#define machine_to_phys_mapping ((unsigned long *)HYPERVISOR_VIRT_START)
+#endif
+
+#ifndef __ASSEMBLY__
+
+/* NB. Both the following are 32 bits each. */
+typedef unsigned long memory_t;   /* Full-sized pointer/address/memory-size. */
+typedef unsigned long cpureg_t;   /* Full-sized register.                    */
+
+/*
+ * Send an array of these to HYPERVISOR_set_trap_table()
+ */
+#define TI_GET_DPL(_ti)      ((_ti)->flags & 3)
+#define TI_GET_IF(_ti)       ((_ti)->flags & 4)
+#define TI_SET_DPL(_ti,_dpl) ((_ti)->flags |= (_dpl))
+#define TI_SET_IF(_ti,_if)   ((_ti)->flags |= ((!!(_if))<<2))
+typedef struct {
+    u8       vector;  /* 0: exception vector                              */
+    u8       flags;   /* 1: 0-3: privilege level; 4: clear event enable?  */
+    u16      cs;      /* 2: code selector                                 */
+    memory_t address; /* 4: code address                                  */
+} PACKED trap_info_t; /* 8 bytes */
+
+typedef struct
+{
+    unsigned long ebx;
+    unsigned long ecx;
+    unsigned long edx;
+    unsigned long esi;
+    unsigned long edi;
+    unsigned long ebp;
+    unsigned long eax;
+    unsigned long ds;
+    unsigned long es;
+    unsigned long fs;
+    unsigned long gs;
+    unsigned long _unused;
+    unsigned long eip;
+    unsigned long cs;
+    unsigned long eflags;
+    unsigned long esp;
+    unsigned long ss;
+} PACKED execution_context_t;
+
+typedef u64 tsc_timestamp_t; /* RDTSC timestamp */
+
+/*
+ * The following is all CPU context. Note that the i387_ctxt block is filled 
+ * in by FXSAVE if the CPU has feature FXSR; otherwise FSAVE is used.
+ */
+typedef struct {
+#define ECF_I387_VALID (1<<0)
+    unsigned long flags;
+    execution_context_t cpu_ctxt;           /* User-level CPU registers     */
+    char          fpu_ctxt[256];            /* User-level FPU registers     */
+    trap_info_t   trap_ctxt[256];           /* Virtual IDT                  */
+    unsigned int  fast_trap_idx;            /* "Fast trap" vector offset    */
+    unsigned long ldt_base, ldt_ents;       /* LDT (linear address, # ents) */
+    unsigned long gdt_frames[16], gdt_ents; /* GDT (machine frames, # ents) */
+    unsigned long guestos_ss, guestos_esp;  /* Virtual TSS (only SS1/ESP1)  */
+    unsigned long pt_base;                  /* CR3 (pagetable base)         */
+    unsigned long debugreg[8];              /* DB0-DB7 (debug registers)    */
+    unsigned long event_callback_cs;        /* CS:EIP of event callback     */
+    unsigned long event_callback_eip;
+    unsigned long failsafe_callback_cs;     /* CS:EIP of failsafe callback  */
+    unsigned long failsafe_callback_eip;
+} PACKED full_execution_context_t;
+
+typedef struct {
+    u64 mfn_to_pfn_start;      /* MFN of start of m2p table */
+    u64 pfn_to_mfn_frame_list; /* MFN of a table of MFNs that 
+                                 make up p2m table */
+} PACKED arch_shared_info_t;
+
+#define ARCH_HAS_FAST_TRAP
+
+#endif
+
+#endif
diff --git a/xen/include/public/arch-x86_64.h b/xen/include/public/arch-x86_64.h
new file mode 100644 (file)
index 0000000..856b507
--- /dev/null
@@ -0,0 +1,134 @@
+/******************************************************************************
+ * arch-x86_64.h
+ * 
+ * Guest OS interface to x86 64-bit Xen.
+ */
+
+#ifndef __XEN_PUBLIC_ARCH_X86_64_H__
+#define __XEN_PUBLIC_ARCH_X86_64_H__
+
+/* Pointers are naturally 64 bits in this architecture; no padding needed. */
+#define _MEMORY_PADDING(_X)
+#define MEMORY_PADDING 
+
+/*
+ * SEGMENT DESCRIPTOR TABLES
+ */
+/*
+ * A number of GDT entries are reserved by Xen. These are not situated at the
+ * start of the GDT because some stupid OSes export hard-coded selector values
+ * in their ABI. These hard-coded values are always near the start of the GDT,
+ * so Xen places itself out of the way.
+ * 
+ * NB. The reserved range is inclusive (that is, both FIRST_RESERVED_GDT_ENTRY
+ * and LAST_RESERVED_GDT_ENTRY are reserved).
+ */
+#define NR_RESERVED_GDT_ENTRIES    40 
+#define FIRST_RESERVED_GDT_ENTRY   256
+#define LAST_RESERVED_GDT_ENTRY    \
+  (FIRST_RESERVED_GDT_ENTRY + NR_RESERVED_GDT_ENTRIES - 1)
+
+/*
+ * 64-bit segment selectors
+ * These flat segments are in the Xen-private section of every GDT. Since these
+ * are also present in the initial GDT, many OSes will be able to avoid
+ * installing their own GDT.
+ */
+
+#define FLAT_RING3_CS32 0x0823  /* GDT index 260 */
+#define FLAT_RING3_CS64 0x082b  /* GDT index 261 */
+#define FLAT_RING3_DS   0x0833  /* GDT index 262 */
+
+#define FLAT_GUESTOS_DS   FLAT_RING3_DS
+#define FLAT_GUESTOS_CS   FLAT_RING3_CS64
+#define FLAT_GUESTOS_CS32 FLAT_RING3_CS32
+
+#define FLAT_USER_DS      FLAT_RING3_DS
+#define FLAT_USER_CS      FLAT_RING3_CS64
+#define FLAT_USER_CS32    FLAT_RING3_CS32
+
+/* And the trap vector is... */
+#define TRAP_INSTR "syscall"
+
+/* The machine->physical mapping table starts at this address, read-only. */
+#ifndef machine_to_phys_mapping
+#define machine_to_phys_mapping ((unsigned long *)0xffff810000000000ULL)
+#endif
+
+#ifndef __ASSEMBLY__
+
+/* NB. Both the following are 64 bits each. */
+typedef unsigned long memory_t;   /* Full-sized pointer/address/memory-size. */
+typedef unsigned long cpureg_t;   /* Full-sized register.                    */
+
+/*
+ * Send an array of these to HYPERVISOR_set_trap_table()
+ */
+#define TI_GET_DPL(_ti)      ((_ti)->flags & 3)
+#define TI_GET_IF(_ti)       ((_ti)->flags & 4)
+#define TI_SET_DPL(_ti,_dpl) ((_ti)->flags |= (_dpl))
+#define TI_SET_IF(_ti,_if)   ((_ti)->flags |= ((!!(_if))<<2))
+typedef struct {
+    u8       vector;  /* 0: exception vector                              */
+    u8       flags;   /* 1: 0-3: privilege level; 4: clear event enable?  */
+    u16      cs;      /* 2: code selector                                 */
+    u32      __pad;   /* 4 */
+    memory_t address; /* 8: code address                                  */
+} PACKED trap_info_t; /* 16 bytes */
+
+typedef struct
+{
+    unsigned long r15;
+    unsigned long r14;
+    unsigned long r13;
+    unsigned long r12;
+    unsigned long rbp;
+    unsigned long rbx;
+    unsigned long r11;
+    unsigned long r10;
+    unsigned long r9;
+    unsigned long r8;
+    unsigned long rax;
+    unsigned long rcx;
+    unsigned long rdx;
+    unsigned long rsi;
+    unsigned long rdi;
+    unsigned long rip;
+    unsigned long cs;
+    unsigned long eflags;
+    unsigned long rsp;
+    unsigned long ss;
+} PACKED execution_context_t;
+
+typedef u64 tsc_timestamp_t; /* RDTSC timestamp */
+
+/*
+ * The following is all CPU context. Note that the i387_ctxt block is filled 
+ * in by FXSAVE if the CPU has feature FXSR; otherwise FSAVE is used.
+ */
+typedef struct {
+#define ECF_I387_VALID (1<<0)
+    unsigned long flags;
+    execution_context_t cpu_ctxt;           /* User-level CPU registers     */
+    char          fpu_ctxt[512];            /* User-level FPU registers     */
+    trap_info_t   trap_ctxt[256];           /* Virtual IDT                  */
+    unsigned long ldt_base, ldt_ents;       /* LDT (linear address, # ents) */
+    unsigned long gdt_frames[16], gdt_ents; /* GDT (machine frames, # ents) */
+    unsigned long guestos_ss, guestos_esp;  /* Virtual TSS (only SS1/ESP1)  */
+    unsigned long pt_base;                  /* CR3 (pagetable base)         */
+    unsigned long debugreg[8];              /* DB0-DB7 (debug registers)    */
+    unsigned long event_callback_cs;        /* CS:EIP of event callback     */
+    unsigned long event_callback_eip;
+    unsigned long failsafe_callback_cs;     /* CS:EIP of failsafe callback  */
+    unsigned long failsafe_callback_eip;
+} PACKED full_execution_context_t;
+
+typedef struct {
+    u64 mfn_to_pfn_start;      /* MFN of start of m2p table */
+    u64 pfn_to_mfn_frame_list; /* MFN of a table of MFNs that 
+                                 make up p2m table */
+} PACKED arch_shared_info_t;
+
+#endif /* !__ASSEMBLY__ */
+
+#endif
diff --git a/xen/include/public/dom0_ops.h b/xen/include/public/dom0_ops.h
new file mode 100644 (file)
index 0000000..e19141c
--- /dev/null
@@ -0,0 +1,372 @@
+/******************************************************************************
+ * dom0_ops.h
+ * 
+ * Process command requests from domain-0 guest OS.
+ * 
+ * Copyright (c) 2002-2003, B Dragovic
+ * Copyright (c) 2002-2004, K Fraser
+ */
+
+
+#ifndef __XEN_PUBLIC_DOM0_OPS_H__
+#define __XEN_PUBLIC_DOM0_OPS_H__
+
+#include "xen.h"
+#include "sched_ctl.h"
+
+/*
+ * Make sure you increment the interface version whenever you modify this file!
+ * This makes sure that old versions of dom0 tools will stop working in a
+ * well-defined way (rather than crashing the machine, for instance).
+ */
+#define DOM0_INTERFACE_VERSION   0xAAAA0019
+
+/************************************************************************/
+
+#define DOM0_GETMEMLIST        2
+typedef struct {
+    /* IN variables. */
+    domid_t       domain;             /*  0 */
+    u16           __pad0;
+    u32           __pad1;
+    memory_t      max_pfns;           /*  8 */
+    MEMORY_PADDING;
+    void         *buffer;             /* 16 */
+    MEMORY_PADDING;
+    /* OUT variables. */
+    memory_t      num_pfns;           /* 24 */
+    MEMORY_PADDING;
+} PACKED dom0_getmemlist_t; /* 32 bytes */
+
+#define DOM0_SCHEDCTL          6
+ /* struct sched_ctl_cmd is from sched-ctl.h   */
+typedef struct sched_ctl_cmd dom0_schedctl_t;
+
+#define DOM0_ADJUSTDOM         7
+/* struct sched_adjdom_cmd is from sched-ctl.h */
+typedef struct sched_adjdom_cmd dom0_adjustdom_t;
+
+#define DOM0_CREATEDOMAIN      8
+typedef struct {
+    /* IN parameters. */
+    memory_t     memory_kb;           /*  0 */
+    MEMORY_PADDING;
+    u32          cpu;                 /*  8 */
+    u32          __pad0;              /* 12 */
+    /* IN/OUT parameters. */
+    /* If 0, domain is allocated. If non-zero use it unless in use. */
+    domid_t      domain;              /* 16 */
+    u16          __pad1;
+    /* OUT parameters. */
+} PACKED dom0_createdomain_t; /* 20 bytes */
+
+#define DOM0_DESTROYDOMAIN     9
+typedef struct {
+    /* IN variables. */
+    domid_t      domain;              /*  0 */
+    u16          __pad;
+} PACKED dom0_destroydomain_t; /* 4 bytes */
+
+#define DOM0_PAUSEDOMAIN      10
+typedef struct {
+    /* IN parameters. */
+    domid_t domain;                   /*  0 */
+    u16     __pad;
+} PACKED dom0_pausedomain_t; /* 4 bytes */
+
+#define DOM0_UNPAUSEDOMAIN    11
+typedef struct {
+    /* IN parameters. */
+    domid_t domain;                   /*  0 */
+    u16     __pad;
+} PACKED dom0_unpausedomain_t; /* 4 bytes */
+
+#define DOM0_GETDOMAININFO    12
+typedef struct {
+    /* IN variables. */
+    domid_t  domain;                  /*  0 */ /* NB. IN/OUT variable. */
+    u16     __pad;
+    /* OUT variables. */
+#define DOMFLAGS_DYING     (1<<0) /* Domain is scheduled to die.             */
+#define DOMFLAGS_CRASHED   (1<<1) /* Crashed domain; frozen for postmortem.  */
+#define DOMFLAGS_SHUTDOWN  (1<<2) /* The guest OS has shut itself down.      */
+#define DOMFLAGS_PAUSED    (1<<3) /* Currently paused by control software.   */
+#define DOMFLAGS_BLOCKED   (1<<4) /* Currently blocked pending an event.     */
+#define DOMFLAGS_RUNNING   (1<<5) /* Domain is currently running.            */
+#define DOMFLAGS_CPUMASK      255 /* CPU to which this domain is bound.      */
+#define DOMFLAGS_CPUSHIFT       8
+#define DOMFLAGS_SHUTDOWNMASK 255 /* DOMFLAGS_SHUTDOWN guest-supplied code.  */
+#define DOMFLAGS_SHUTDOWNSHIFT 16
+    u32      flags;                   /*  4 */
+    full_execution_context_t *ctxt;   /*  8 */ /* NB. IN/OUT variable. */
+    MEMORY_PADDING;
+    memory_t tot_pages;               /* 16 */
+    MEMORY_PADDING;
+    memory_t max_pages;               /* 24 */
+    MEMORY_PADDING;
+    memory_t shared_info_frame;       /* 32: MFN of shared_info struct */
+    MEMORY_PADDING;
+    u64      cpu_time;                /* 40 */
+} PACKED dom0_getdomaininfo_t; /* 48 bytes */
+
+#define DOM0_BUILDDOMAIN      13
+typedef struct {
+    /* IN variables. */
+    domid_t                 domain;   /*  0 */
+    u16                     __pad0;   /*  2 */
+    u32                     __pad1;   /*  4 */
+    /* IN/OUT parameters */
+    full_execution_context_t *ctxt;   /*  8 */
+    MEMORY_PADDING;
+} PACKED dom0_builddomain_t; /* 16 bytes */
+
+#define DOM0_IOPL             14
+typedef struct {
+    domid_t domain;                   /*  0 */
+    u16     __pad;
+    u32     iopl;                     /*  4 */
+} PACKED dom0_iopl_t; /* 8 bytes */
+
+#define DOM0_MSR              15
+typedef struct {
+    /* IN variables. */
+    u32 write;                        /*  0 */
+    u32 cpu_mask;                     /*  4 */
+    u32 msr;                          /*  8 */
+    u32 in1;                          /* 12 */
+    u32 in2;                          /* 16 */
+    /* OUT variables. */
+    u32 out1;                         /* 20 */
+    u32 out2;                         /* 24 */
+} PACKED dom0_msr_t; /* 28 bytes */
+
+#define DOM0_DEBUG            16
+typedef struct {
+    /* IN variables. */
+    domid_t domain;                   /*  0 */
+    u8  opcode;                       /*  2 */
+    u8  __pad;
+    u32 in1;                          /*  4 */
+    u32 in2;                          /*  8 */
+    u32 in3;                          /* 12 */
+    u32 in4;                          /* 16 */
+    /* OUT variables. */
+    u32 status;                       /* 20 */
+    u32 out1;                         /* 24 */
+    u32 out2;                         /* 28 */
+} PACKED dom0_debug_t; /* 32 bytes */
+
+/*
+ * Set clock such that it would read <secs,usecs> after 00:00:00 UTC,
+ * 1 January, 1970 if the current system time was <system_time>.
+ */
+#define DOM0_SETTIME          17
+typedef struct {
+    /* IN variables. */
+    u32 secs;                         /*  0 */
+    u32 usecs;                        /*  4 */
+    u64 system_time;                  /*  8 */
+} PACKED dom0_settime_t; /* 16 bytes */
+
+#define DOM0_GETPAGEFRAMEINFO 18
+#define NOTAB 0         /* normal page */
+#define L1TAB (1<<28)
+#define L2TAB (2<<28)
+#define L3TAB (3<<28)
+#define L4TAB (4<<28)
+#define LPINTAB  (1<<31)
+#define XTAB  (0xf<<28) /* invalid page */
+#define LTAB_MASK XTAB
+#define LTABTYPE_MASK (0x7<<28)
+
+typedef struct {
+    /* IN variables. */
+    memory_t pfn;          /*  0: Machine page frame number to query.       */
+    MEMORY_PADDING;
+    domid_t domain;        /*  8: To which domain does the frame belong?    */
+    u16     __pad;
+    /* OUT variables. */
+    /* Is the page PINNED to a type? */
+    u32 type;              /* 12: see above type defs */
+} PACKED dom0_getpageframeinfo_t; /* 16 bytes */
+
+/*
+ * Read console content from Xen buffer ring.
+ */
+#define DOM0_READCONSOLE      19
+typedef struct {
+    memory_t str;                     /*  0 */
+    MEMORY_PADDING;
+    u32      count;                   /*  8 */
+    u32      cmd;                     /* 12 */
+} PACKED dom0_readconsole_t; /* 16 bytes */
+
+/* 
+ * Pin Domain to a particular CPU  (use -1 to unpin)
+ */
+#define DOM0_PINCPUDOMAIN     20
+typedef struct {
+    /* IN variables. */
+    domid_t      domain;              /*  0 */
+    u16          __pad;
+    s32          cpu;                 /*  4: -1 implies unpin */
+} PACKED dom0_pincpudomain_t; /* 8 bytes */
+
+/* Get trace buffers machine base address */
+#define DOM0_GETTBUFS         21
+typedef struct {
+    /* OUT variables */
+    memory_t mach_addr;   /*  0: location of the trace buffers       */
+    MEMORY_PADDING;
+    u32      size;        /*  8: size of each trace buffer, in bytes */
+} PACKED dom0_gettbufs_t; /* 12 bytes */
+
+/*
+ * Get physical information about the host machine
+ */
+#define DOM0_PHYSINFO         22
+typedef struct {
+    u32      ht_per_core;             /*  0 */
+    u32      cores;                   /*  4 */
+    u32      cpu_khz;                 /*  8 */
+    u32      __pad;                   /* 12 */
+    memory_t total_pages;             /* 16 */
+    MEMORY_PADDING;
+    memory_t free_pages;              /* 24 */
+    MEMORY_PADDING;
+} PACKED dom0_physinfo_t; /* 32 bytes */
+
+/* 
+ * Allow a domain access to a physical PCI device
+ */
+#define DOM0_PCIDEV_ACCESS    23
+typedef struct {
+    /* IN variables. */
+    domid_t      domain;              /*  0 */
+    u16          __pad;
+    u32          bus;                 /*  4 */
+    u32          dev;                 /*  8 */
+    u32          func;                /* 12 */
+    u32          enable;              /* 16 */
+} PACKED dom0_pcidev_access_t; /* 20 bytes */
+
+/*
+ * Get the ID of the current scheduler.
+ */
+#define DOM0_SCHED_ID        24
+typedef struct {
+    /* OUT variable */
+    u32 sched_id;                     /*  0 */
+} PACKED dom0_sched_id_t; /* 4 bytes */
+
+/* 
+ * Control shadow pagetables operation
+ */
+#define DOM0_SHADOW_CONTROL  25
+
+#define DOM0_SHADOW_CONTROL_OP_OFF         0
+#define DOM0_SHADOW_CONTROL_OP_ENABLE_TEST 1
+#define DOM0_SHADOW_CONTROL_OP_ENABLE_LOGDIRTY 2
+#define DOM0_SHADOW_CONTROL_OP_ENABLE_TRANSLATE 3
+#define DOM0_SHADOW_CONTROL_OP_FLUSH       10     /* table ops */
+#define DOM0_SHADOW_CONTROL_OP_CLEAN       11
+#define DOM0_SHADOW_CONTROL_OP_PEEK        12
+
+typedef struct dom0_shadow_control
+{
+    u32 fault_count;
+    u32 dirty_count;
+    u32 dirty_net_count;     
+    u32 dirty_block_count;     
+} dom0_shadow_control_stats_t;
+
+typedef struct {
+    /* IN variables. */
+    domid_t        domain;            /*  0 */
+    u16            __pad;
+    u32            op;                /*  4 */
+    unsigned long *dirty_bitmap;      /*  8: pointer to locked buffer */
+    MEMORY_PADDING;
+    /* IN/OUT variables. */
+    memory_t       pages;  /* 16: size of buffer, updated with actual size */
+    MEMORY_PADDING;
+    /* OUT variables. */
+    dom0_shadow_control_stats_t stats;
+} PACKED dom0_shadow_control_t;
+
+#define DOM0_SETDOMAININITIALMEM   27
+typedef struct {
+    /* IN variables. */
+    domid_t     domain;               /*  0 */
+    u16         __pad0;
+    u32         __pad1;
+    memory_t    initial_memkb;        /*  8 */
+    MEMORY_PADDING;
+} PACKED dom0_setdomaininitialmem_t; /* 16 bytes */
+
+#define DOM0_SETDOMAINMAXMEM   28
+typedef struct {
+    /* IN variables. */
+    domid_t     domain;               /*  0 */
+    u16         __pad0;
+    u32         __pad1;
+    memory_t    max_memkb;            /*  8 */
+    MEMORY_PADDING;
+} PACKED dom0_setdomainmaxmem_t; /* 16 bytes */
+
+#define DOM0_GETPAGEFRAMEINFO2 29   /* batched interface */
+typedef struct {
+    /* IN variables. */
+    domid_t  domain;                  /*  0 */
+    u16      __pad0;
+    u32      __pad1;
+    memory_t num;                     /*  8 */
+    MEMORY_PADDING;
+    /* IN/OUT variables. */
+    unsigned long *array;             /* 16 */
+    MEMORY_PADDING;
+} PACKED dom0_getpageframeinfo2_t; /* 24 bytes */
+
+#define DOM0_SETDOMAINVMASSIST   30
+typedef struct {
+    /* IN variables. */
+    domid_t      domain;              /*  0 */
+    u16          __pad0;
+    u32          cmd;                 /*  4: vm_assist cmd */
+    u32          type;                /*  8: vm_assist cmd */
+} PACKED dom0_setdomainvmassist_t; /* 12 bytes */
+
+typedef struct {
+    u32 cmd;                          /* 0 */
+    u32 interface_version;            /* 4 */ /* DOM0_INTERFACE_VERSION */
+    union {                           /* 8 */
+       u32                      dummy[18]; /* 72 bytes */
+        dom0_createdomain_t      createdomain;
+        dom0_pausedomain_t       pausedomain;
+        dom0_unpausedomain_t     unpausedomain;
+        dom0_destroydomain_t     destroydomain;
+        dom0_getmemlist_t        getmemlist;
+        dom0_schedctl_t          schedctl;
+        dom0_adjustdom_t         adjustdom;
+        dom0_builddomain_t       builddomain;
+        dom0_getdomaininfo_t     getdomaininfo;
+        dom0_getpageframeinfo_t  getpageframeinfo;
+        dom0_iopl_t              iopl;
+       dom0_msr_t               msr;
+       dom0_debug_t             debug;
+       dom0_settime_t           settime;
+       dom0_readconsole_t       readconsole;
+       dom0_pincpudomain_t      pincpudomain;
+        dom0_gettbufs_t          gettbufs;
+        dom0_physinfo_t          physinfo;
+        dom0_pcidev_access_t     pcidev_access;
+        dom0_sched_id_t          sched_id;
+       dom0_shadow_control_t    shadow_control;
+       dom0_setdomaininitialmem_t setdomaininitialmem;
+       dom0_setdomainmaxmem_t   setdomainmaxmem;
+       dom0_getpageframeinfo2_t getpageframeinfo2;
+       dom0_setdomainvmassist_t setdomainvmassist;
+    } PACKED u;
+} PACKED dom0_op_t; /* 80 bytes */
+
+#endif /* __XEN_PUBLIC_DOM0_OPS_H__ */
diff --git a/xen/include/public/event_channel.h b/xen/include/public/event_channel.h
new file mode 100644 (file)
index 0000000..284326d
--- /dev/null
@@ -0,0 +1,161 @@
+/******************************************************************************
+ * event_channel.h
+ * 
+ * Event channels between domains.
+ * 
+ * Copyright (c) 2003-2004, K A Fraser.
+ */
+
+#ifndef __XEN_PUBLIC_EVENT_CHANNEL_H__
+#define __XEN_PUBLIC_EVENT_CHANNEL_H__
+
+/*
+ * EVTCHNOP_alloc_unbound: Allocate a fresh local port and prepare
+ * it for binding to <dom>.
+ */
+#define EVTCHNOP_alloc_unbound    6
+typedef struct {
+    /* IN parameters */
+    domid_t dom;                      /*  0 */
+    u16     __pad;
+    /* OUT parameters */
+    u32     port;                     /*  4 */
+} PACKED evtchn_alloc_unbound_t; /* 8 bytes */
+
+/*
+ * EVTCHNOP_bind_interdomain: Construct an interdomain event channel between
+ * <dom1> and <dom2>. Either <port1> or <port2> may be wildcarded by setting to
+ * zero. On successful return both <port1> and <port2> are filled in and
+ * <dom1,port1> is fully bound to <dom2,port2>.
+ * 
+ * NOTES:
+ *  1. A wildcarded port is allocated from the relevant domain's free list
+ *     (i.e., some port that was previously EVTCHNSTAT_closed). However, if the
+ *     remote port pair is already fully bound then a port is not allocated,
+ *     and instead the existing local port is returned to the caller.
+ *  2. If the caller is unprivileged then <dom1> must be DOMID_SELF.
+ *  3. If the caller is unprivileged and <dom2,port2> is EVTCHNSTAT_closed
+ *     then <dom2> must be DOMID_SELF.
+ *  4. If either port is already bound then it must be bound to the other
+ *     specified domain and port (if not wildcarded).
+ *  5. If either port is awaiting binding (EVTCHNSTAT_unbound) then it must
+ *     be awaiting binding to the other domain, and the other port pair must
+ *     be closed or unbound.
+ */
+#define EVTCHNOP_bind_interdomain 0
+typedef struct {
+    /* IN parameters. */
+    domid_t dom1, dom2;               /*  0,  2 */
+    /* IN/OUT parameters. */
+    u32     port1, port2;             /*  4,  8 */
+} PACKED evtchn_bind_interdomain_t; /* 12 bytes */
+
+/*
+ * EVTCHNOP_bind_virq: Bind a local event channel to IRQ <irq>.
+ * NOTES:
+ *  1. A virtual IRQ may be bound to at most one event channel per domain.
+ */
+#define EVTCHNOP_bind_virq        1
+typedef struct {
+    /* IN parameters. */
+    u32 virq;                         /*  0 */
+    /* OUT parameters. */
+    u32 port;                         /*  4 */
+} PACKED evtchn_bind_virq_t; /* 8 bytes */
+
+/*
+ * EVTCHNOP_bind_pirq: Bind a local event channel to IRQ <irq>.
+ * NOTES:
+ *  1. A physical IRQ may be bound to at most one event channel per domain.
+ *  2. Only a sufficiently-privileged domain may bind to a physical IRQ.
+ */
+#define EVTCHNOP_bind_pirq        2
+typedef struct {
+    /* IN parameters. */
+    u32 pirq;                         /*  0 */
+#define BIND_PIRQ__WILL_SHARE 1
+    u32 flags; /* BIND_PIRQ__* */     /*  4 */
+    /* OUT parameters. */
+    u32 port;                         /*  8 */
+} PACKED evtchn_bind_pirq_t; /* 12 bytes */
+
+/*
+ * EVTCHNOP_close: Close the communication channel which has an endpoint at
+ * <dom, port>. If the channel is interdomain then the remote end is placed in
+ * the unbound state (EVTCHNSTAT_unbound), awaiting a new connection.
+ * NOTES:
+ *  1. <dom> may be specified as DOMID_SELF.
+ *  2. Only a sufficiently-privileged domain may close an event channel
+ *     for which <dom> is not DOMID_SELF.
+ */
+#define EVTCHNOP_close            3
+typedef struct {
+    /* IN parameters. */
+    domid_t dom;                      /*  0 */
+    u16     __pad;
+    u32     port;                     /*  4 */
+    /* No OUT parameters. */
+} PACKED evtchn_close_t; /* 8 bytes */
+
+/*
+ * EVTCHNOP_send: Send an event to the remote end of the channel whose local
+ * endpoint is <DOMID_SELF, local_port>.
+ */
+#define EVTCHNOP_send             4
+typedef struct {
+    /* IN parameters. */
+    u32     local_port;               /*  0 */
+    /* No OUT parameters. */
+} PACKED evtchn_send_t; /* 4 bytes */
+
+/*
+ * EVTCHNOP_status: Get the current status of the communication channel which
+ * has an endpoint at <dom, port>.
+ * NOTES:
+ *  1. <dom> may be specified as DOMID_SELF.
+ *  2. Only a sufficiently-privileged domain may obtain the status of an event
+ *     channel for which <dom> is not DOMID_SELF.
+ */
+#define EVTCHNOP_status           5
+typedef struct {
+    /* IN parameters */
+    domid_t dom;                      /*  0 */
+    u16     __pad;
+    u32     port;                     /*  4 */
+    /* OUT parameters */
+#define EVTCHNSTAT_closed       0  /* Channel is not in use.                 */
+#define EVTCHNSTAT_unbound      1  /* Channel is waiting interdom connection.*/
+#define EVTCHNSTAT_interdomain  2  /* Channel is connected to remote domain. */
+#define EVTCHNSTAT_pirq         3  /* Channel is bound to a phys IRQ line.   */
+#define EVTCHNSTAT_virq         4  /* Channel is bound to a virtual IRQ line */
+    u32     status;                   /*  8 */
+    union {                           /* 12 */
+        struct {
+            domid_t dom;                              /* 12 */
+        } PACKED unbound; /* EVTCHNSTAT_unbound */
+        struct {
+            domid_t dom;                              /* 12 */
+            u16     __pad;
+            u32     port;                             /* 16 */
+        } PACKED interdomain; /* EVTCHNSTAT_interdomain */
+        u32 pirq;      /* EVTCHNSTAT_pirq        */   /* 12 */
+        u32 virq;      /* EVTCHNSTAT_virq        */   /* 12 */
+    } PACKED u;
+} PACKED evtchn_status_t; /* 20 bytes */
+
+typedef struct {
+    u32 cmd; /* EVTCHNOP_* */         /*  0 */
+    u32 __reserved;                   /*  4 */
+    union {                           /*  8 */
+        evtchn_alloc_unbound_t    alloc_unbound;
+        evtchn_bind_interdomain_t bind_interdomain;
+        evtchn_bind_virq_t        bind_virq;
+        evtchn_bind_pirq_t        bind_pirq;
+        evtchn_close_t            close;
+        evtchn_send_t             send;
+        evtchn_status_t           status;
+        u8                        __dummy[24];
+    } PACKED u;
+} PACKED evtchn_op_t; /* 32 bytes */
+
+#endif /* __XEN_PUBLIC_EVENT_CHANNEL_H__ */
diff --git a/xen/include/public/grant_table.h b/xen/include/public/grant_table.h
new file mode 100644 (file)
index 0000000..389e082
--- /dev/null
@@ -0,0 +1,251 @@
+/******************************************************************************
+ * grant_table.h
+ * 
+ * Interface for granting foreign access to page frames, and receiving
+ * page-ownership transfers.
+ * 
+ * Copyright (c) 2004, K A Fraser
+ */
+
+#ifndef __XEN_PUBLIC_GRANT_TABLE_H__
+#define __XEN_PUBLIC_GRANT_TABLE_H__
+
+
+/***********************************
+ * GRANT TABLE REPRESENTATION
+ */
+
+/* Some rough guidelines on accessing and updating grant-table entries
+ * in a concurrency-safe manner. For more information, Linux contains a
+ * reference implementation for guest OSes (arch/xen/kernel/grant_table.c).
+ * 
+ * NB. WMB is a no-op on current-generation x86 processors. However, a
+ *     compiler barrier will still be required.
+ * 
+ * Introducing a valid entry into the grant table:
+ *  1. Write ent->domid.
+ *  2. Write ent->frame:
+ *      GTF_permit_access:   Frame to which access is permitted.
+ *      GTF_accept_transfer: Pseudo-phys frame slot being filled by new
+ *                           frame, or zero if none.
+ *  3. Write memory barrier (WMB).
+ *  4. Write ent->flags, inc. valid type.
+ * 
+ * Invalidating an unused GTF_permit_access entry:
+ *  1. flags = ent->flags.
+ *  2. Observe that !(flags & (GTF_reading|GTF_writing)).
+ *  3. Check result of SMP-safe CMPXCHG(&ent->flags, flags, 0).
+ *  NB. No need for WMB as reuse of entry is control-dependent on success of
+ *      step 3, and all architectures guarantee ordering of ctrl-dep writes.
+ *
+ * Invalidating an in-use GTF_permit_access entry:
+ *  This cannot be done directly. Request assistance from the domain controller
+ *  which can set a timeout on the use of a grant entry and take necessary
+ *  action. (NB. This is not yet implemented!).
+ * 
+ * Invalidating an unused GTF_accept_transfer entry:
+ *  1. flags = ent->flags.
+ *  2. Observe that !(flags & GTF_transfer_committed). [*]
+ *  3. Check result of SMP-safe CMPXCHG(&ent->flags, flags, 0).
+ *  NB. No need for WMB as reuse of entry is control-dependent on success of
+ *      step 3, and all architectures guarantee ordering of ctrl-dep writes.
+ *  [*] If GTF_transfer_committed is set then the grant entry is 'committed'.
+ *      The guest must /not/ modify the grant entry until the address of the
+ *      transferred frame is written. It is safe for the guest to spin waiting
+ *      for this to occur (detect by observing GTF_transfer_completed in
+ *      ent->flags).
+ *
+ * Invalidating a committed GTF_accept_transfer entry:
+ *  1. Wait for (ent->flags & GTF_transfer_completed).
+ *
+ * Changing a GTF_permit_access from writable to read-only:
+ *  Use SMP-safe CMPXCHG to set GTF_readonly, while checking !GTF_writing.
+ * 
+ * Changing a GTF_permit_access from read-only to writable:
+ *  Use SMP-safe bit-setting instruction.
+ */
+
+/*
+ * A grant table comprises a packed array of grant entries in one or more
+ * page frames shared between Xen and a guest.
+ * [XEN]: This field is written by Xen and read by the sharing guest.
+ * [GST]: This field is written by the guest and read by Xen.
+ */
+typedef struct {
+    /* GTF_xxx: various type and flag information.  [XEN,GST] */
+    u16     flags;      /* 0 */
+    /* The domain being granted foreign privileges. [GST] */
+    domid_t domid;      /* 2 */
+    /*
+     * GTF_permit_access: Frame that @domid is allowed to map and access. [GST]
+     * GTF_accept_transfer: Frame whose ownership transferred by @domid. [XEN]
+     */
+    u32     frame;      /* 4 */
+} PACKED grant_entry_t; /* 8 bytes */
+
+/*
+ * Type of grant entry.
+ *  GTF_invalid: This grant entry grants no privileges.
+ *  GTF_permit_access: Allow @domid to map/access @frame.
+ *  GTF_accept_transfer: Allow @domid to transfer ownership of one page frame
+ *                       to this guest. Xen writes the page number to @frame.
+ */
+#define GTF_invalid         (0U<<0)
+#define GTF_permit_access   (1U<<0)
+#define GTF_accept_transfer (2U<<0)
+#define GTF_type_mask       (3U<<0)
+
+/*
+ * Subflags for GTF_permit_access.
+ *  GTF_readonly: Restrict @domid to read-only mappings and accesses. [GST]
+ *  GTF_reading: Grant entry is currently mapped for reading by @domid. [XEN]
+ *  GTF_writing: Grant entry is currently mapped for writing by @domid. [XEN]
+ */
+#define _GTF_readonly       (2)
+#define GTF_readonly        (1U<<_GTF_readonly)
+#define _GTF_reading        (3)
+#define GTF_reading         (1U<<_GTF_reading)
+#define _GTF_writing        (4)
+#define GTF_writing         (1U<<_GTF_writing)
+
+/*
+ * Subflags for GTF_accept_transfer:
+ *  GTF_transfer_committed: Xen sets this flag to indicate that it is committed
+ *      to transferring ownership of a page frame. When a guest sees this flag
+ *      it must /not/ modify the grant entry until GTF_transfer_completed is
+ *      set by Xen.
+ *  GTF_transfer_completed: It is safe for the guest to spin-wait on this flag
+ *      after reading GTF_transfer_committed. Xen will always write the frame
+ *      address, followed by ORing this flag, in a timely manner.
+ */
+#define _GTF_transfer_committed (2)
+#define GTF_transfer_committed  (1U<<_GTF_transfer_committed)
+#define _GTF_transfer_completed (3)
+#define GTF_transfer_completed  (1U<<_GTF_transfer_completed)
+
+
+/***********************************
+ * GRANT TABLE QUERIES AND USES
+ */
+
+/*
+ * Reference to a grant entry in a specified domain's grant table.
+ */
+typedef u16 grant_ref_t;
+
+/*
+ * GNTTABOP_map_grant_ref: Map the grant entry (<dom>,<ref>) for access
+ * by devices and/or host CPUs. If successful, <handle> is a tracking number
+ * that must be presented later to destroy the mapping(s). On error, <handle>
+ * is a negative status code.
+ * NOTES:
+ *  1. If GNTPIN_map_for_dev is specified then <dev_bus_addr> is the address
+ *     via which I/O devices may access the granted frame.
+ *  2. If GNTPIN_map_for_host is specified then a mapping will be added at
+ *     virtual address <host_virt_addr> in the current address space.
+ *  3. Mappings should only be destroyed via GNTTABOP_unmap_grant_ref. If a
+ *     host mapping is destroyed by other means then it is *NOT* guaranteed
+ *     to be accounted to the correct grant reference!
+ */
+#define GNTTABOP_map_grant_ref        0
+typedef struct {
+    /* IN parameters. */
+    memory_t    host_virt_addr;       /*  0 */
+    MEMORY_PADDING;
+    domid_t     dom;                  /*  8 */
+    grant_ref_t ref;                  /* 10 */
+    u16         flags;                /* 12: GNTMAP_* */
+    /* OUT parameters. */
+    s16         handle;               /* 14: +ve: handle; -ve: GNTST_* */
+    memory_t    dev_bus_addr;         /* 16 */
+    MEMORY_PADDING;
+} PACKED gnttab_map_grant_ref_t; /* 24 bytes */
+
+/*
+ * GNTTABOP_unmap_grant_ref: Destroy one or more grant-reference mappings
+ * tracked by <handle>. If <host_virt_addr> or <dev_bus_addr> is zero, that
+ * field is ignored. If non-zero, they must refer to a device/host mapping
+ * that is tracked by <handle>
+ * NOTES:
+ *  1. The call may fail in an undefined manner if either mapping is not
+ *     tracked by <handle>.
+ *  3. After executing a batch of unmaps, it is guaranteed that no stale
+ *     mappings will remain in the device or host TLBs.
+ */
+#define GNTTABOP_unmap_grant_ref      1
+typedef struct {
+    /* IN parameters. */
+    memory_t    host_virt_addr;       /*  0 */
+    MEMORY_PADDING;
+    memory_t    dev_bus_addr;         /*  8 */
+    MEMORY_PADDING;
+    u16         handle;               /* 16 */
+    /* OUT parameters. */
+    s16         status;               /* 18: GNTST_* */
+    u32         __pad;
+} PACKED gnttab_unmap_grant_ref_t; /* 24 bytes */
+
+/*
+ * GNTTABOP_setup_table: Set up a grant table for <dom> comprising at least
+ * <nr_frames> pages. The frame addresses are written to the <frame_list>.
+ * Only <nr_frames> addresses are written, even if the table is larger.
+ * NOTES:
+ *  1. <dom> may be specified as DOMID_SELF.
+ *  2. Only a sufficiently-privileged domain may specify <dom> != DOMID_SELF.
+ *  3. Xen may not support more than a single grant-table page per domain.
+ */
+#define GNTTABOP_setup_table          2
+typedef struct {
+    /* IN parameters. */
+    domid_t     dom;                  /*  0 */
+    u16         nr_frames;            /*  2 */
+    u16         __pad;
+    /* OUT parameters. */
+    s16         status;               /*  6: GNTST_* */
+    unsigned long *frame_list;        /*  8 */
+    MEMORY_PADDING;
+} PACKED gnttab_setup_table_t; /* 16 bytes */
+
+/*
+ * Bitfield values for update_pin_status.flags.
+ */
+ /* Map the grant entry for access by I/O devices. */
+#define _GNTMAP_device_map      (0)
+#define GNTMAP_device_map       (1<<_GNTMAP_device_map)
+ /* Map the grant entry for access by host CPUs. */
+#define _GNTMAP_host_map        (1)
+#define GNTMAP_host_map         (1<<_GNTMAP_host_map)
+ /* Accesses to the granted frame will be restricted to read-only access. */
+#define _GNTMAP_readonly        (2)
+#define GNTMAP_readonly         (1<<_GNTMAP_readonly)
+ /*
+  * GNTMAP_host_map subflag:
+  *  0 => The host mapping is usable only by the guest OS.
+  *  1 => The host mapping is usable by guest OS + current application.
+  */
+#define _GNTMAP_application_map (3)
+#define GNTMAP_application_map  (1<<_GNTMAP_application_map)
+
+/*
+ * Values for error status returns. All errors are -ve.
+ */
+#define GNTST_okay             (0)
+#define GNTST_general_error    (-1) /* General undefined error.              */
+#define GNTST_bad_domain       (-2) /* Unrecognsed domain id.                */
+#define GNTST_bad_gntref       (-3) /* Unrecognised or inappropriate gntref. */
+#define GNTST_bad_handle       (-3) /* Unrecognised or inappropriate handle. */
+#define GNTST_no_device_space  (-4) /* Out of space in I/O MMU.              */
+#define GNTST_permission_denied (-5) /* Not enough privilege for operation.  */
+
+#define GNTTABOP_error_msgs {                   \
+    "okay",                                     \
+    "undefined error",                          \
+    "unrecognised domain id",                   \
+    "invalid grant reference",                  \
+    "invalid mapping handle",                   \
+    "no spare translation slot in the I/O MMU", \
+    "permission denied"                         \
+}
+        
+
+#endif /* __XEN_PUBLIC_GRANT_TABLE_H__ */
diff --git a/xen/include/public/io/blkif.h b/xen/include/public/io/blkif.h
new file mode 100644 (file)
index 0000000..8cd3696
--- /dev/null
@@ -0,0 +1,115 @@
+/******************************************************************************
+ * blkif.h
+ * 
+ * Unified block-device I/O interface for Xen guest OSes.
+ * 
+ * Copyright (c) 2003-2004, Keir Fraser
+ */
+
+#ifndef __XEN_PUBLIC_IO_BLKIF_H__
+#define __XEN_PUBLIC_IO_BLKIF_H__
+
+#define blkif_vdev_t   u16
+#define blkif_sector_t u64
+
+#define BLKIF_OP_READ      0
+#define BLKIF_OP_WRITE     1
+#define BLKIF_OP_PROBE     2
+
+/* NB. Ring size must be small enough for sizeof(blkif_ring_t) <= PAGE_SIZE. */
+#define BLKIF_RING_SIZE        64
+
+/*
+ * Maximum scatter/gather segments per request.
+ * This is carefully chosen so that sizeof(blkif_ring_t) <= PAGE_SIZE.
+ * NB. This could be 12 if the ring indexes weren't stored in the same page.
+ */
+#define BLKIF_MAX_SEGMENTS_PER_REQUEST 11
+
+typedef struct {
+    u8             operation;    /*  0: BLKIF_OP_???                         */
+    u8             nr_segments;  /*  1: number of segments                   */
+    blkif_vdev_t   device;       /*  2: only for read/write requests         */
+    unsigned long  id;           /*  4: private guest value, echoed in resp  */
+    blkif_sector_t sector_number;    /* start sector idx on disk (r/w only)  */
+    /* @f_a_s[2:0]=last_sect ; @f_a_s[5:3]=first_sect ; @f_a_s[:12]=frame.   */
+    /* @first_sect: first sector in frame to transfer (inclusive).           */
+    /* @last_sect: last sector in frame to transfer (inclusive).             */
+    /* @frame: machine page frame number.                                    */
+    unsigned long  frame_and_sects[BLKIF_MAX_SEGMENTS_PER_REQUEST];
+} PACKED blkif_request_t;
+
+#define blkif_first_sect(_fas) (((_fas)>>3)&7)
+#define blkif_last_sect(_fas)  ((_fas)&7)
+
+typedef struct {
+    unsigned long   id;              /* copied from request */
+    u8              operation;       /* copied from request */
+    s16             status;          /* BLKIF_RSP_???       */
+} PACKED blkif_response_t;
+
+#define BLKIF_RSP_ERROR  -1 /* non-specific 'error' */
+#define BLKIF_RSP_OKAY    0 /* non-specific 'okay'  */
+
+/*
+ * We use a special capitalised type name because it is _essential_ that all 
+ * arithmetic on indexes is done on an integer type of the correct size.
+ */
+typedef u32 BLKIF_RING_IDX;
+
+/*
+ * Ring indexes are 'free running'. That is, they are not stored modulo the
+ * size of the ring buffer. The following macro converts a free-running counter
+ * into a value that can directly index a ring-buffer array.
+ */
+#define MASK_BLKIF_IDX(_i) ((_i)&(BLKIF_RING_SIZE-1))
+
+typedef struct {
+    BLKIF_RING_IDX req_prod;  /*  0: Request producer. Updated by front-end. */
+    BLKIF_RING_IDX resp_prod; /*  4: Response producer. Updated by back-end. */
+    union {                   /*  8 */
+        blkif_request_t  req;
+        blkif_response_t resp;
+    } PACKED ring[BLKIF_RING_SIZE];
+} PACKED blkif_ring_t;
+
+
+/*
+ * BLKIF_OP_PROBE:
+ * The request format for a probe request is constrained as follows:
+ *  @operation   == BLKIF_OP_PROBE
+ *  @nr_segments == size of probe buffer in pages
+ *  @device      == unused (zero)
+ *  @id          == any value (echoed in response message)
+ *  @sector_num  == unused (zero)
+ *  @frame_and_sects == list of page-sized buffers.
+ *                       (i.e., @first_sect == 0, @last_sect == 7).
+ * 
+ * The response is a list of vdisk_t elements copied into the out-of-band
+ * probe buffer. On success the response status field contains the number
+ * of vdisk_t elements.
+ */
+
+/* XXX SMH: Type values below are chosen to match ide_xxx in Linux ide.h. */
+#define VDISK_TYPE_FLOPPY  0x00
+#define VDISK_TYPE_TAPE    0x01
+#define VDISK_TYPE_CDROM   0x05
+#define VDISK_TYPE_OPTICAL 0x07
+#define VDISK_TYPE_DISK    0x20 
+
+#define VDISK_TYPE_MASK    0x3F
+#define VDISK_TYPE(_x)     ((_x) & VDISK_TYPE_MASK) 
+
+/* The top two bits of the type field encode various flags. */
+#define VDISK_FLAG_RO      0x40
+#define VDISK_FLAG_VIRT    0x80
+#define VDISK_READONLY(_x) ((_x) & VDISK_FLAG_RO)
+#define VDISK_VIRTUAL(_x)  ((_x) & VDISK_FLAG_VIRT) 
+
+typedef struct {
+    blkif_sector_t capacity;     /*  0: Size in terms of 512-byte sectors.   */
+    blkif_vdev_t   device;       /*  8: Device number (opaque 16 bit value). */
+    u16            info;         /* 10: Device type and flags (VDISK_*).     */
+} PACKED vdisk_t; /* 12 bytes */
+
+#endif /* __XEN_PUBLIC_IO_BLKIF_H__ */
diff --git a/xen/include/public/io/domain_controller.h b/xen/include/public/io/domain_controller.h
new file mode 100644 (file)
index 0000000..5a4056c
--- /dev/null
@@ -0,0 +1,578 @@
+/******************************************************************************
+ * domain_controller.h
+ * 
+ * Interface to server controller (e.g., 'xend'). This header file defines the 
+ * interface that is shared with guest OSes.
+ * 
+ * Copyright (c) 2004, K A Fraser
+ */
+
+#ifndef __XEN_PUBLIC_IO_DOMAIN_CONTROLLER_H__
+#define __XEN_PUBLIC_IO_DOMAIN_CONTROLLER_H__
+
+
+/*
+ * Reason codes for SCHEDOP_shutdown. These are opaque to Xen but may be
+ * interpreted by control software to determine the appropriate action. These 
+ * are only really advisories: the controller can actually do as it likes.
+ */
+#define SHUTDOWN_poweroff   0  /* Domain exited normally. Clean up and kill. */
+#define SHUTDOWN_reboot     1  /* Clean up, kill, and then restart.          */
+#define SHUTDOWN_suspend    2  /* Clean up, save suspend info, kill.         */
+
+
+/*
+ * CONTROLLER MESSAGING INTERFACE.
+ */
+
+typedef struct {
+    u8 type;     /*  0: echoed in response */
+    u8 subtype;  /*  1: echoed in response */
+    u8 id;       /*  2: echoed in response */
+    u8 length;   /*  3: number of bytes in 'msg' */
+    u8 msg[60];  /*  4: type-specific message data */
+} PACKED control_msg_t; /* 64 bytes */
+
+#define CONTROL_RING_SIZE 8
+typedef u32 CONTROL_RING_IDX;
+#define MASK_CONTROL_IDX(_i) ((_i)&(CONTROL_RING_SIZE-1))
+
+typedef struct {
+    control_msg_t tx_ring[CONTROL_RING_SIZE];   /*    0: guest -> controller */
+    control_msg_t rx_ring[CONTROL_RING_SIZE];   /*  512: controller -> guest */
+    CONTROL_RING_IDX tx_req_prod, tx_resp_prod; /* 1024, 1028 */
+    CONTROL_RING_IDX rx_req_prod, rx_resp_prod; /* 1032, 1036 */
+} PACKED control_if_t; /* 1040 bytes */
+
+/*
+ * Top-level command types.
+ */
+#define CMSG_CONSOLE        0  /* Console                 */
+#define CMSG_BLKIF_BE       1  /* Block-device backend    */
+#define CMSG_BLKIF_FE       2  /* Block-device frontend   */
+#define CMSG_NETIF_BE       3  /* Network-device backend  */
+#define CMSG_NETIF_FE       4  /* Network-device frontend */
+#define CMSG_SHUTDOWN       6  /* Shutdown messages       */
+#define CMSG_MEM_REQUEST    7  /* Memory reservation reqs */
+
+
+/******************************************************************************
+ * CONSOLE DEFINITIONS
+ */
+
+/*
+ * Subtypes for console messages.
+ */
+#define CMSG_CONSOLE_DATA       0
+
+
+/******************************************************************************
+ * BLOCK-INTERFACE FRONTEND DEFINITIONS
+ */
+
+/* Messages from domain controller to guest. */
+#define CMSG_BLKIF_FE_INTERFACE_STATUS           0
+
+/* Messages from guest to domain controller. */
+#define CMSG_BLKIF_FE_DRIVER_STATUS             32
+#define CMSG_BLKIF_FE_INTERFACE_CONNECT         33
+#define CMSG_BLKIF_FE_INTERFACE_DISCONNECT      34
+#define CMSG_BLKIF_FE_INTERFACE_QUERY           35
+
+/* These are used by both front-end and back-end drivers. */
+#define blkif_vdev_t   u16
+#define blkif_pdev_t   u16
+#define blkif_sector_t u64
+
+/*
+ * CMSG_BLKIF_FE_INTERFACE_STATUS:
+ *  Notify a guest about a status change on one of its block interfaces.
+ *  If the interface is DESTROYED or DOWN then the interface is disconnected:
+ *   1. The shared-memory frame is available for reuse.
+ *   2. Any unacknowledged messages pending on the interface were dropped.
+ */
+#define BLKIF_INTERFACE_STATUS_CLOSED       0 /* Interface doesn't exist.    */
+#define BLKIF_INTERFACE_STATUS_DISCONNECTED 1 /* Exists but is disconnected. */
+#define BLKIF_INTERFACE_STATUS_CONNECTED    2 /* Exists and is connected.    */
+#define BLKIF_INTERFACE_STATUS_CHANGED      3 /* A device has been added or removed. */
+typedef struct {
+    u32 handle; /*  0 */
+    u32 status; /*  4 */
+    u16 evtchn; /*  8: (only if status == BLKIF_INTERFACE_STATUS_CONNECTED). */
+    domid_t domid; /* 10: status != BLKIF_INTERFACE_STATUS_DESTROYED */
+} PACKED blkif_fe_interface_status_t; /* 12 bytes */
+
+/*
+ * CMSG_BLKIF_FE_DRIVER_STATUS:
+ *  Notify the domain controller that the front-end driver is DOWN or UP.
+ *  When the driver goes DOWN then the controller will send no more
+ *  status-change notifications.
+ *  If the driver goes DOWN while interfaces are still UP, the domain
+ *  will automatically take the interfaces DOWN.
+ * 
+ *  NB. The controller should not send an INTERFACE_STATUS_CHANGED message
+ *  for interfaces that are active when it receives an UP notification. We
+ *  expect that the frontend driver will query those interfaces itself.
+ */
+#define BLKIF_DRIVER_STATUS_DOWN   0
+#define BLKIF_DRIVER_STATUS_UP     1
+typedef struct {
+    /* IN */
+    u32 status;        /*  0: BLKIF_DRIVER_STATUS_??? */
+    /* OUT */
+    /* Driver should query interfaces [0..max_handle]. */
+    u32 max_handle;    /*  4 */
+} PACKED blkif_fe_driver_status_t; /* 8 bytes */
+
+/*
+ * CMSG_BLKIF_FE_INTERFACE_CONNECT:
+ *  If successful, the domain controller will acknowledge with a
+ *  STATUS_CONNECTED message.
+ */
+typedef struct {
+    u32      handle;      /*  0 */
+    u32      __pad;
+    memory_t shmem_frame; /*  8 */
+    MEMORY_PADDING;
+} PACKED blkif_fe_interface_connect_t; /* 16 bytes */
+
+/*
+ * CMSG_BLKIF_FE_INTERFACE_DISCONNECT:
+ *  If successful, the domain controller will acknowledge with a
+ *  STATUS_DISCONNECTED message.
+ */
+typedef struct {
+    u32 handle; /*  0 */
+} PACKED blkif_fe_interface_disconnect_t; /* 4 bytes */
+
+/*
+ * CMSG_BLKIF_FE_INTERFACE_QUERY:
+ */
+typedef struct {
+    /* IN */
+    u32 handle; /*  0 */
+    /* OUT */
+    u32 status; /*  4 */
+    u16 evtchn; /*  8: (only if status == BLKIF_INTERFACE_STATUS_CONNECTED). */
+    domid_t domid; /* 10: status != BLKIF_INTERFACE_STATUS_DESTROYED */
+} PACKED blkif_fe_interface_query_t; /* 12 bytes */
+
+
+/******************************************************************************
+ * BLOCK-INTERFACE BACKEND DEFINITIONS
+ */
+
+/* Messages from domain controller. */
+#define CMSG_BLKIF_BE_CREATE      0  /* Create a new block-device interface. */
+#define CMSG_BLKIF_BE_DESTROY     1  /* Destroy a block-device interface.    */
+#define CMSG_BLKIF_BE_CONNECT     2  /* Connect i/f to remote driver.        */
+#define CMSG_BLKIF_BE_DISCONNECT  3  /* Disconnect i/f from remote driver.   */
+#define CMSG_BLKIF_BE_VBD_CREATE  4  /* Create a new VBD for an interface.   */
+#define CMSG_BLKIF_BE_VBD_DESTROY 5  /* Delete a VBD from an interface.      */
+#define CMSG_BLKIF_BE_VBD_GROW    6  /* Append an extent to a given VBD.     */
+#define CMSG_BLKIF_BE_VBD_SHRINK  7  /* Remove last extent from a given VBD. */
+
+/* Messages to domain controller. */
+#define CMSG_BLKIF_BE_DRIVER_STATUS 32
+
+/*
+ * Message request/response definitions for block-device messages.
+ */
+
+typedef struct {
+    blkif_sector_t sector_start;   /*  0 */
+    blkif_sector_t sector_length;  /*  8 */
+    blkif_pdev_t   device;         /* 16 */
+    u16            __pad;          /* 18 */
+} PACKED blkif_extent_t; /* 20 bytes */
+
+/* Non-specific 'okay' return. */
+#define BLKIF_BE_STATUS_OKAY                0
+/* Non-specific 'error' return. */
+#define BLKIF_BE_STATUS_ERROR               1
+/* The following are specific error returns. */
+#define BLKIF_BE_STATUS_INTERFACE_EXISTS    2
+#define BLKIF_BE_STATUS_INTERFACE_NOT_FOUND 3
+#define BLKIF_BE_STATUS_INTERFACE_CONNECTED 4
+#define BLKIF_BE_STATUS_VBD_EXISTS          5
+#define BLKIF_BE_STATUS_VBD_NOT_FOUND       6
+#define BLKIF_BE_STATUS_OUT_OF_MEMORY       7
+#define BLKIF_BE_STATUS_EXTENT_NOT_FOUND    8
+#define BLKIF_BE_STATUS_MAPPING_ERROR       9
+
+/* This macro can be used to create an array of descriptive error strings. */
+#define BLKIF_BE_STATUS_ERRORS {    \
+    "Okay",                         \
+    "Non-specific error",           \
+    "Interface already exists",     \
+    "Interface not found",          \
+    "Interface is still connected", \
+    "VBD already exists",           \
+    "VBD not found",                \
+    "Out of memory",                \
+    "Extent not found for VBD",     \
+    "Could not map domain memory" }
+
+/*
+ * CMSG_BLKIF_BE_CREATE:
+ *  When the driver sends a successful response then the interface is fully
+ *  created. The controller will send a DOWN notification to the front-end
+ *  driver.
+ */
+typedef struct { 
+    /* IN */
+    domid_t    domid;         /*  0: Domain attached to new interface.   */
+    u16        __pad;
+    u32        blkif_handle;  /*  4: Domain-specific interface handle.   */
+    /* OUT */
+    u32        status;        /*  8 */
+} PACKED blkif_be_create_t; /* 12 bytes */
+
+/*
+ * CMSG_BLKIF_BE_DESTROY:
+ *  When the driver sends a successful response then the interface is fully
+ *  torn down. The controller will send a DESTROYED notification to the
+ *  front-end driver.
+ */
+typedef struct { 
+    /* IN */
+    domid_t    domid;         /*  0: Identify interface to be destroyed. */
+    u16        __pad;
+    u32        blkif_handle;  /*  4: ...ditto...                         */
+    /* OUT */
+    u32        status;        /*  8 */
+} PACKED blkif_be_destroy_t; /* 12 bytes */
+
+/*
+ * CMSG_BLKIF_BE_CONNECT:
+ *  When the driver sends a successful response then the interface is fully
+ *  connected. The controller will send a CONNECTED notification to the
+ *  front-end driver.
+ */
+typedef struct { 
+    /* IN */
+    domid_t    domid;         /*  0: Domain attached to new interface.   */
+    u16        __pad;
+    u32        blkif_handle;  /*  4: Domain-specific interface handle.   */
+    memory_t   shmem_frame;   /*  8: Page cont. shared comms window.     */
+    MEMORY_PADDING;
+    u32        evtchn;        /* 16: Event channel for notifications.    */
+    /* OUT */
+    u32        status;        /* 20 */
+} PACKED blkif_be_connect_t;  /* 24 bytes */
+
+/*
+ * CMSG_BLKIF_BE_DISCONNECT:
+ *  When the driver sends a successful response then the interface is fully
+ *  disconnected. The controller will send a DOWN notification to the front-end
+ *  driver.
+ */
+typedef struct { 
+    /* IN */
+    domid_t    domid;         /*  0: Domain attached to new interface.   */
+    u16        __pad;
+    u32        blkif_handle;  /*  4: Domain-specific interface handle.   */
+    /* OUT */
+    u32        status;        /*  8 */
+} PACKED blkif_be_disconnect_t; /* 12 bytes */
+
+/* CMSG_BLKIF_BE_VBD_CREATE */
+typedef struct { 
+    /* IN */
+    domid_t    domid;         /*  0: Identify blkdev interface.          */
+    u16        __pad;
+    u32        blkif_handle;  /*  4: ...ditto...                         */
+    blkif_vdev_t vdevice;     /*  8: Interface-specific id for this VBD. */
+    u16        readonly;      /* 10: Non-zero -> VBD isn't writable.     */
+    /* OUT */
+    u32        status;        /* 12 */
+} PACKED blkif_be_vbd_create_t; /* 16 bytes */
+
+/* CMSG_BLKIF_BE_VBD_DESTROY */
+typedef struct {
+    /* IN */
+    domid_t    domid;         /*  0: Identify blkdev interface.          */
+    u16        __pad0;        /*  2 */
+    u32        blkif_handle;  /*  4: ...ditto...                         */
+    blkif_vdev_t vdevice;     /*  8: Interface-specific id of the VBD.   */
+    u16        __pad1;        /* 10 */
+    /* OUT */
+    u32        status;        /* 12 */
+} PACKED blkif_be_vbd_destroy_t; /* 16 bytes */
+
+/* CMSG_BLKIF_BE_VBD_GROW */
+typedef struct { 
+    /* IN */
+    domid_t    domid;         /*  0: Identify blkdev interface.          */
+    u16        __pad0;        /*  2 */
+    u32        blkif_handle;  /*  4: ...ditto...                         */
+    blkif_extent_t extent;    /*  8: Physical extent to append to VBD.   */
+    blkif_vdev_t vdevice;     /* 28: Interface-specific id of the VBD.   */
+    u16        __pad1;        /* 30 */
+    /* OUT */
+    u32        status;        /* 32 */
+} PACKED blkif_be_vbd_grow_t; /* 36 bytes */
+
+/* CMSG_BLKIF_BE_VBD_SHRINK */
+typedef struct { 
+    /* IN */
+    domid_t    domid;         /*  0: Identify blkdev interface.          */
+    u16        __pad0;        /*  2 */
+    u32        blkif_handle;  /*  4: ...ditto...                         */
+    blkif_vdev_t vdevice;     /*  8: Interface-specific id of the VBD.   */
+    u16        __pad1;        /* 10 */
+    /* OUT */
+    u32        status;        /* 12 */
+} PACKED blkif_be_vbd_shrink_t; /* 16 bytes */
+
+/*
+ * CMSG_BLKIF_BE_DRIVER_STATUS:
+ *  Notify the domain controller that the back-end driver is DOWN or UP.
+ *  If the driver goes DOWN while interfaces are still UP, the controller
+ *  will automatically send DOWN notifications.
+ */
+typedef struct {
+    u32        status;        /*  0: BLKIF_DRIVER_STATUS_??? */
+} PACKED blkif_be_driver_status_t; /* 4 bytes */
+
+
+/******************************************************************************
+ * NETWORK-INTERFACE FRONTEND DEFINITIONS
+ */
+
+/* Messages from domain controller to guest. */
+#define CMSG_NETIF_FE_INTERFACE_STATUS   0
+
+/* Messages from guest to domain controller. */
+#define CMSG_NETIF_FE_DRIVER_STATUS             32
+#define CMSG_NETIF_FE_INTERFACE_CONNECT         33
+#define CMSG_NETIF_FE_INTERFACE_DISCONNECT      34
+#define CMSG_NETIF_FE_INTERFACE_QUERY           35
+
+/*
+ * CMSG_NETIF_FE_INTERFACE_STATUS:
+ *  Notify a guest about a status change on one of its network interfaces.
+ *  If the interface is CLOSED or DOWN then the interface is disconnected:
+ *   1. The shared-memory frame is available for reuse.
+ *   2. Any unacknowledged messgaes pending on the interface were dropped.
+ */
+#define NETIF_INTERFACE_STATUS_CLOSED       0 /* Interface doesn't exist.    */
+#define NETIF_INTERFACE_STATUS_DISCONNECTED 1 /* Exists but is disconnected. */
+#define NETIF_INTERFACE_STATUS_CONNECTED    2 /* Exists and is connected.    */
+#define NETIF_INTERFACE_STATUS_CHANGED      3 /* A device has been added or removed. */
+typedef struct {
+    u32        handle; /*  0 */
+    u32        status; /*  4 */
+    u16        evtchn; /*  8: status == NETIF_INTERFACE_STATUS_CONNECTED */
+    u8         mac[6]; /* 10: status == NETIF_INTERFACE_STATUS_CONNECTED */
+    domid_t    domid;  /* 16: status != NETIF_INTERFACE_STATUS_DESTROYED */
+} PACKED netif_fe_interface_status_t; /* 18 bytes */
+
+/*
+ * CMSG_NETIF_FE_DRIVER_STATUS:
+ *  Notify the domain controller that the front-end driver is DOWN or UP.
+ *  When the driver goes DOWN then the controller will send no more
+ *  status-change notifications.
+ *  If the driver goes DOWN while interfaces are still UP, the domain
+ *  will automatically take the interfaces DOWN.
+ * 
+ *  NB. The controller should not send an INTERFACE_STATUS message
+ *  for interfaces that are active when it receives an UP notification. We
+ *  expect that the frontend driver will query those interfaces itself.
+ */
+#define NETIF_DRIVER_STATUS_DOWN   0
+#define NETIF_DRIVER_STATUS_UP     1
+typedef struct {
+    /* IN */
+    u32        status;        /*  0: NETIF_DRIVER_STATUS_??? */
+    /* OUT */
+    /* Driver should query interfaces [0..max_handle]. */
+    u32        max_handle;    /*  4 */
+} PACKED netif_fe_driver_status_t; /* 8 bytes */
+
+/*
+ * CMSG_NETIF_FE_INTERFACE_CONNECT:
+ *  If successful, the domain controller will acknowledge with a
+ *  STATUS_CONNECTED message.
+ */
+typedef struct {
+    u32        handle;         /*  0 */
+    u32        __pad;          /*  4 */
+    memory_t   tx_shmem_frame; /*  8 */
+    MEMORY_PADDING;
+    memory_t   rx_shmem_frame; /* 16 */
+    MEMORY_PADDING;
+} PACKED netif_fe_interface_connect_t; /* 24 bytes */
+
+/*
+ * CMSG_NETIF_FE_INTERFACE_DISCONNECT:
+ *  If successful, the domain controller will acknowledge with a
+ *  STATUS_DISCONNECTED message.
+ */
+typedef struct {
+    u32        handle;        /*  0 */
+} PACKED netif_fe_interface_disconnect_t; /* 4 bytes */
+
+/*
+ * CMSG_NETIF_FE_INTERFACE_QUERY:
+ */
+typedef struct {
+    /* IN */
+    u32        handle; /*  0 */
+    /* OUT */
+    u32        status; /*  4 */
+    u16        evtchn; /*  8: status == NETIF_INTERFACE_STATUS_CONNECTED */
+    u8         mac[6]; /* 10: status == NETIF_INTERFACE_STATUS_CONNECTED */
+    domid_t    domid;  /* 16: status != NETIF_INTERFACE_STATUS_DESTROYED */
+} PACKED netif_fe_interface_query_t; /* 18 bytes */
+
+
+/******************************************************************************
+ * NETWORK-INTERFACE BACKEND DEFINITIONS
+ */
+
+/* Messages from domain controller. */
+#define CMSG_NETIF_BE_CREATE      0  /* Create a new net-device interface. */
+#define CMSG_NETIF_BE_DESTROY     1  /* Destroy a net-device interface.    */
+#define CMSG_NETIF_BE_CONNECT     2  /* Connect i/f to remote driver.        */
+#define CMSG_NETIF_BE_DISCONNECT  3  /* Disconnect i/f from remote driver.   */
+
+/* Messages to domain controller. */
+#define CMSG_NETIF_BE_DRIVER_STATUS 32
+
+/*
+ * Message request/response definitions for net-device messages.
+ */
+
+/* Non-specific 'okay' return. */
+#define NETIF_BE_STATUS_OKAY                0
+/* Non-specific 'error' return. */
+#define NETIF_BE_STATUS_ERROR               1
+/* The following are specific error returns. */
+#define NETIF_BE_STATUS_INTERFACE_EXISTS    2
+#define NETIF_BE_STATUS_INTERFACE_NOT_FOUND 3
+#define NETIF_BE_STATUS_INTERFACE_CONNECTED 4
+#define NETIF_BE_STATUS_OUT_OF_MEMORY       5
+#define NETIF_BE_STATUS_MAPPING_ERROR       6
+
+/* This macro can be used to create an array of descriptive error strings. */
+#define NETIF_BE_STATUS_ERRORS {    \
+    "Okay",                         \
+    "Non-specific error",           \
+    "Interface already exists",     \
+    "Interface not found",          \
+    "Interface is still connected", \
+    "Out of memory",                \
+    "Could not map domain memory" }
+
+/*
+ * CMSG_NETIF_BE_CREATE:
+ *  When the driver sends a successful response then the interface is fully
+ *  created. The controller will send a DOWN notification to the front-end
+ *  driver.
+ */
+typedef struct { 
+    /* IN */
+    domid_t    domid;         /*  0: Domain attached to new interface.   */
+    u16        __pad0;        /*  2 */
+    u32        netif_handle;  /*  4: Domain-specific interface handle.   */
+    u8         mac[6];        /*  8 */
+    u16        __pad1;        /* 14 */
+    /* OUT */
+    u32        status;        /* 16 */
+} PACKED netif_be_create_t; /* 20 bytes */
+
+/*
+ * CMSG_NETIF_BE_DESTROY:
+ *  When the driver sends a successful response then the interface is fully
+ *  torn down. The controller will send a DESTROYED notification to the
+ *  front-end driver.
+ */
+typedef struct { 
+    /* IN */
+    domid_t    domid;         /*  0: Identify interface to be destroyed. */
+    u16        __pad;
+    u32        netif_handle;  /*  4: ...ditto...                         */
+    /* OUT */
+    u32   status;             /*  8 */
+} PACKED netif_be_destroy_t; /* 12 bytes */
+
+/*
+ * CMSG_NETIF_BE_CONNECT:
+ *  When the driver sends a successful response then the interface is fully
+ *  connected. The controller will send a CONNECTED notification to the
+ *  front-end driver.
+ */
+typedef struct { 
+    /* IN */
+    domid_t    domid;          /*  0: Domain attached to new interface.   */
+    u16        __pad0;         /*  2 */
+    u32        netif_handle;   /*  4: Domain-specific interface handle.   */
+    memory_t   tx_shmem_frame; /*  8: Page cont. tx shared comms window.  */
+    MEMORY_PADDING;
+    memory_t   rx_shmem_frame; /* 16: Page cont. rx shared comms window.  */
+    MEMORY_PADDING;
+    u16        evtchn;         /* 24: Event channel for notifications.    */
+    u16        __pad1;         /* 26 */
+    /* OUT */
+    u32        status;         /* 28 */
+} PACKED netif_be_connect_t; /* 32 bytes */
+
+/*
+ * CMSG_NETIF_BE_DISCONNECT:
+ *  When the driver sends a successful response then the interface is fully
+ *  disconnected. The controller will send a DOWN notification to the front-end
+ *  driver.
+ */
+typedef struct { 
+    /* IN */
+    domid_t    domid;         /*  0: Domain attached to new interface.   */
+    u16        __pad;
+    u32        netif_handle;  /*  4: Domain-specific interface handle.   */
+    /* OUT */
+    u32        status;        /*  8 */
+} PACKED netif_be_disconnect_t; /* 12 bytes */
+
+/*
+ * CMSG_NETIF_BE_DRIVER_STATUS:
+ *  Notify the domain controller that the back-end driver is DOWN or UP.
+ *  If the driver goes DOWN while interfaces are still UP, the domain
+ *  will automatically send DOWN notifications.
+ */
+typedef struct {
+    u32        status;        /*  0: NETIF_DRIVER_STATUS_??? */
+} PACKED netif_be_driver_status_t; /* 4 bytes */
+
+
+/******************************************************************************
+ * SHUTDOWN DEFINITIONS
+ */
+
+/*
+ * Subtypes for shutdown messages.
+ */
+#define CMSG_SHUTDOWN_POWEROFF  0   /* Clean shutdown (SHUTDOWN_poweroff).   */
+#define CMSG_SHUTDOWN_REBOOT    1   /* Clean shutdown (SHUTDOWN_reboot).     */
+#define CMSG_SHUTDOWN_SUSPEND   2   /* Create suspend info, then             */
+                                    /* SHUTDOWN_suspend.                     */
+
+
+/******************************************************************************
+ * MEMORY CONTROLS
+ */
+
+#define CMSG_MEM_REQUEST_SET 0 /* Request a domain to set its mem footprint. */
+
+/*
+ * CMSG_MEM_REQUEST:
+ *  Request that the domain change its memory reservation.
+ */
+typedef struct {
+    /* OUT */
+    u32 target;       /* 0: Target memory reservation in pages.       */
+    /* IN  */
+    u32 status;       /* 4: Return code indicates success or failure. */
+} PACKED mem_request_t; /* 8 bytes */
+
+
+#endif /* __XEN_PUBLIC_IO_DOMAIN_CONTROLLER_H__ */
diff --git a/xen/include/public/io/netif.h b/xen/include/public/io/netif.h
new file mode 100644 (file)
index 0000000..839cc8d
--- /dev/null
@@ -0,0 +1,92 @@
+/******************************************************************************
+ * netif.h
+ * 
+ * Unified network-device I/O interface for Xen guest OSes.
+ * 
+ * Copyright (c) 2003-2004, Keir Fraser
+ */
+
+#ifndef __XEN_PUBLIC_IO_NETIF_H__
+#define __XEN_PUBLIC_IO_NETIF_H__
+
+typedef struct {
+    memory_t addr;   /*  0: Machine address of packet.  */
+    MEMORY_PADDING;
+    u16      id;     /*  8: Echoed in response message. */
+    u16      size;   /* 10: Packet size in bytes.       */
+} PACKED netif_tx_request_t; /* 12 bytes */
+
+typedef struct {
+    u16      id;     /*  0 */
+    s8       status; /*  2 */
+    u8       __pad;  /*  3 */
+} PACKED netif_tx_response_t; /* 4 bytes */
+
+typedef struct {
+    u16       id;    /*  0: Echoed in response message.        */
+} PACKED netif_rx_request_t; /* 2 bytes */
+
+typedef struct {
+    memory_t addr;   /*  0: Machine address of packet.              */
+    MEMORY_PADDING;
+    u16      id;     /*  8:  */
+    s16      status; /* 10: -ve: BLKIF_RSP_* ; +ve: Rx'ed pkt size. */
+} PACKED netif_rx_response_t; /* 12 bytes */
+
+/*
+ * We use a special capitalised type name because it is _essential_ that all 
+ * arithmetic on indexes is done on an integer type of the correct size.
+ */
+typedef u32 NETIF_RING_IDX;
+
+/*
+ * Ring indexes are 'free running'. That is, they are not stored modulo the
+ * size of the ring buffer. The following macros convert a free-running counter
+ * into a value that can directly index a ring-buffer array.
+ */
+#define MASK_NETIF_RX_IDX(_i) ((_i)&(NETIF_RX_RING_SIZE-1))
+#define MASK_NETIF_TX_IDX(_i) ((_i)&(NETIF_TX_RING_SIZE-1))
+
+#define NETIF_TX_RING_SIZE 256
+#define NETIF_RX_RING_SIZE 256
+
+/* This structure must fit in a memory page. */
+typedef struct {
+    /*
+     * Frontend places packets into ring at tx_req_prod.
+     * Frontend receives event when tx_resp_prod passes tx_event.
+     * 'req_cons' is a shadow of the backend's request consumer -- the frontend
+     * may use it to determine if all queued packets have been seen by the
+     * backend.
+     */
+    NETIF_RING_IDX req_prod;       /*  0 */
+    NETIF_RING_IDX req_cons;       /*  4 */
+    NETIF_RING_IDX resp_prod;      /*  8 */
+    NETIF_RING_IDX event;          /* 12 */
+    union {                        /* 16 */
+        netif_tx_request_t  req;
+        netif_tx_response_t resp;
+    } PACKED ring[NETIF_TX_RING_SIZE];
+} PACKED netif_tx_interface_t;
+
+/* This structure must fit in a memory page. */
+typedef struct {
+    /*
+     * Frontend places empty buffers into ring at rx_req_prod.
+     * Frontend receives event when rx_resp_prod passes rx_event.
+     */
+    NETIF_RING_IDX req_prod;       /*  0 */
+    NETIF_RING_IDX resp_prod;      /*  4 */
+    NETIF_RING_IDX event;          /*  8 */
+    union {                        /* 12 */
+        netif_rx_request_t  req;
+        netif_rx_response_t resp;
+    } PACKED ring[NETIF_RX_RING_SIZE];
+} PACKED netif_rx_interface_t;
+
+/* Descriptor status values */
+#define NETIF_RSP_DROPPED         -2
+#define NETIF_RSP_ERROR           -1
+#define NETIF_RSP_OKAY             0
+
+#endif
diff --git a/xen/include/public/physdev.h b/xen/include/public/physdev.h
new file mode 100644 (file)
index 0000000..ab1af99
--- /dev/null
@@ -0,0 +1,80 @@
+/* -*-  Mode:C; c-basic-offset:4; tab-width:4 -*-
+ ****************************************************************************
+ * (c) 2004 - Rolf Neugebauer - Intel Research Cambridge
+ * (c) 2004 - Keir Fraser - University of Cambridge
+ ****************************************************************************
+ * Description: Interface for domains to access physical devices on the PCI bus
+ */
+
+#ifndef __XEN_PUBLIC_PHYSDEV_H__
+#define __XEN_PUBLIC_PHYSDEV_H__
+
+/* Commands to HYPERVISOR_physdev_op() */
+#define PHYSDEVOP_PCI_CFGREG_READ       0
+#define PHYSDEVOP_PCI_CFGREG_WRITE      1
+#define PHYSDEVOP_PCI_INITIALISE_DEVICE 2
+#define PHYSDEVOP_PCI_PROBE_ROOT_BUSES  3
+#define PHYSDEVOP_IRQ_UNMASK_NOTIFY     4
+#define PHYSDEVOP_IRQ_STATUS_QUERY      5
+
+/* Read from PCI configuration space. */
+typedef struct {
+    /* IN */
+    u32 bus;                          /*  0 */
+    u32 dev;                          /*  4 */
+    u32 func;                         /*  8 */
+    u32 reg;                          /* 12 */
+    u32 len;                          /* 16 */
+    /* OUT */
+    u32 value;                        /* 20 */
+} PACKED physdevop_pci_cfgreg_read_t; /* 24 bytes */
+
+/* Write to PCI configuration space. */
+typedef struct {
+    /* IN */
+    u32 bus;                          /*  0 */
+    u32 dev;                          /*  4 */
+    u32 func;                         /*  8 */
+    u32 reg;                          /* 12 */
+    u32 len;                          /* 16 */
+    u32 value;                        /* 20 */
+} PACKED physdevop_pci_cfgreg_write_t; /* 24 bytes */
+
+/* Do final initialisation of a PCI device (e.g., last-moment IRQ routing). */
+typedef struct {
+    /* IN */
+    u32 bus;                          /*  0 */
+    u32 dev;                          /*  4 */
+    u32 func;                         /*  8 */
+} PACKED physdevop_pci_initialise_device_t; /* 12 bytes */
+
+/* Find the root buses for subsequent scanning. */
+typedef struct {
+    /* OUT */
+    u32 busmask[256/32];              /*  0 */
+} PACKED physdevop_pci_probe_root_buses_t; /* 32 bytes */
+
+typedef struct {
+    /* IN */
+    u32 irq;                          /*  0 */
+    /* OUT */
+/* Need to call PHYSDEVOP_IRQ_UNMASK_NOTIFY when the IRQ has been serviced? */
+#define PHYSDEVOP_IRQ_NEEDS_UNMASK_NOTIFY (1<<0)
+    u32 flags;                        /*  4 */
+} PACKED physdevop_irq_status_query_t; /* 8 bytes */
+
+typedef struct _physdev_op_st 
+{
+    u32 cmd;                          /*  0 */
+    u32 __pad;                        /*  4 */
+    union {                           /*  8 */
+        physdevop_pci_cfgreg_read_t       pci_cfgreg_read;
+        physdevop_pci_cfgreg_write_t      pci_cfgreg_write;
+        physdevop_pci_initialise_device_t pci_initialise_device;
+        physdevop_pci_probe_root_buses_t  pci_probe_root_buses;
+        physdevop_irq_status_query_t      irq_status_query;
+        u8                                __dummy[32];
+    } PACKED u;
+} PACKED physdev_op_t; /* 40 bytes */
+
+#endif /* __XEN_PUBLIC_PHYSDEV_H__ */
diff --git a/xen/include/public/sched_ctl.h b/xen/include/public/sched_ctl.h
new file mode 100644 (file)
index 0000000..bd6a717
--- /dev/null
@@ -0,0 +1,70 @@
+/**
+ * Generic scheduler control interface.
+ *
+ * Mark Williamson, (C) 2004 Intel Research Cambridge
+ */
+
+#ifndef __XEN_PUBLIC_SCHED_CTL_H__
+#define __XEN_PUBLIC_SCHED_CTL_H__
+
+/* Scheduler types */
+#define SCHED_BVT      0
+#define SCHED_ATROPOS  2
+#define SCHED_RROBIN   3
+
+/* these describe the intended direction used for a scheduler control or domain
+ * command */
+#define SCHED_INFO_PUT 0
+#define SCHED_INFO_GET 1
+
+/*
+ * Generic scheduler control command - used to adjust system-wide scheduler
+ * parameters
+ */
+struct sched_ctl_cmd
+{
+    u32 sched_id;                     /*  0 */
+    u32 direction;                    /*  4 */
+    union {                           /*  8 */
+        struct bvt_ctl
+        {
+            /* IN variables. */
+            u32 ctx_allow;            /*  8: context switch allowance */
+        } PACKED bvt;
+
+        struct rrobin_ctl
+        {
+            /* IN variables */
+            u64 slice;                /*  8: round robin time slice */
+        } PACKED rrobin;
+    } PACKED u;
+} PACKED; /* 16 bytes */
+
+struct sched_adjdom_cmd
+{
+    u32     sched_id;                 /*  0 */
+    u32     direction;                /*  4 */
+    domid_t domain;                   /*  8 */
+    u16     __pad0;
+    u32     __pad1;
+    union {                           /* 16 */
+        struct bvt_adjdom
+        {
+            u32 mcu_adv;            /* 16: mcu advance: inverse of weight */
+            u32 warpback;           /* 20: warp? */
+            s32 warpvalue;          /* 24: warp value */
+            long long warpl;        /* 32: warp limit */
+            long long warpu;        /* 40: unwarp time requirement */
+        } PACKED bvt;
+
+        struct atropos_adjdom
+        {
+            u64 nat_period; /* 16 */
+            u64 nat_slice;  /* 24 */
+            u64 latency;    /* 32 */
+            u32 xtratime;   /* 36 */
+        } PACKED atropos;
+    } PACKED u;
+} PACKED; /* 40 bytes */
+
+#endif /* __XEN_PUBLIC_SCHED_CTL_H__ */
diff --git a/xen/include/public/trace.h b/xen/include/public/trace.h
new file mode 100644 (file)
index 0000000..5e7904d
--- /dev/null
@@ -0,0 +1,31 @@
+/******************************************************************************
+ * trace.h
+ */
+
+#ifndef __XEN_PUBLIC_TRACE_H__
+#define __XEN_PUBLIC_TRACE_H__
+
+/* This structure represents a single trace buffer record. */
+struct t_rec {
+    u64 cycles;               /* 64 bit cycle counter timestamp */
+    u32 event;                /* 32 bit event ID                */
+    u32 d1, d2, d3, d4, d5;   /* event data items               */
+};
+
+/*
+ * This structure contains the metadata for a single trace buffer.  The head
+ * field, indexes into an array of struct t_rec's.
+ */
+struct t_buf {
+    unsigned long data;      /* pointer to data area.  machine address
+                              * for convenience in user space code           */
+
+    unsigned long size;      /* size of the data area, in t_recs             */
+    unsigned long head;      /* array index of the most recent record        */
+
+    /* Xen-private elements follow... */
+    struct t_rec *head_ptr; /* pointer to the head record                    */
+    struct t_rec *vdata;    /* virtual address pointer to data               */
+};
+
+#endif /* __XEN_PUBLIC_TRACE_H__ */
diff --git a/xen/include/public/xen.h b/xen/include/public/xen.h
new file mode 100644 (file)
index 0000000..f103509
--- /dev/null
@@ -0,0 +1,425 @@
+/******************************************************************************
+ * xen.h
+ * 
+ * Guest OS interface to Xen.
+ * 
+ * Copyright (c) 2004, K A Fraser
+ */
+
+#ifndef __XEN_PUBLIC_XEN_H__
+#define __XEN_PUBLIC_XEN_H__
+
+/* GCC-specific way to pack structure definitions (no implicit padding). */
+#define PACKED __attribute__ ((packed))
+
+#if defined(__i386__)
+#include "arch-x86_32.h"
+#elif defined(__x86_64__)
+#include "arch-x86_64.h"
+#else
+#error "Unsupported architecture"
+#endif
+
+/*
+ * XEN "SYSTEM CALLS" (a.k.a. HYPERCALLS).
+ */
+
+/* EAX = vector; EBX, ECX, EDX, ESI, EDI = args 1, 2, 3, 4, 5. */
+#define __HYPERVISOR_set_trap_table        0
+#define __HYPERVISOR_mmu_update            1
+#define __HYPERVISOR_set_gdt               2
+#define __HYPERVISOR_stack_switch          3
+#define __HYPERVISOR_set_callbacks         4
+#define __HYPERVISOR_fpu_taskswitch        5
+#define __HYPERVISOR_sched_op              6
+#define __HYPERVISOR_dom0_op               7
+#define __HYPERVISOR_set_debugreg          8
+#define __HYPERVISOR_get_debugreg          9
+#define __HYPERVISOR_update_descriptor    10
+#define __HYPERVISOR_set_fast_trap        11
+#define __HYPERVISOR_dom_mem_op           12
+#define __HYPERVISOR_multicall            13
+#define __HYPERVISOR_update_va_mapping    14
+#define __HYPERVISOR_set_timer_op         15
+#define __HYPERVISOR_event_channel_op     16
+#define __HYPERVISOR_xen_version          17
+#define __HYPERVISOR_console_io           18
+#define __HYPERVISOR_physdev_op           19
+#define __HYPERVISOR_grant_table_op       20
+#define __HYPERVISOR_vm_assist            21
+#define __HYPERVISOR_update_va_mapping_otherdomain 22
+
+/*
+ * MULTICALLS
+ * 
+ * Multicalls are listed in an array, with each element being a fixed size 
+ * (BYTES_PER_MULTICALL_ENTRY). Each is of the form (op, arg1, ..., argN)
+ * where each element of the tuple is a machine word. 
+ */
+#define ARGS_PER_MULTICALL_ENTRY 8
+
+
+/* 
+ * VIRTUAL INTERRUPTS
+ * 
+ * Virtual interrupts that a guest OS may receive from Xen.
+ */
+#define VIRQ_MISDIRECT  0  /* Catch-all interrupt for unbound VIRQs.      */
+#define VIRQ_TIMER      1  /* Timebase update, and/or requested timeout.  */
+#define VIRQ_DEBUG      2  /* Request guest to dump debug info.           */
+#define VIRQ_CONSOLE    3  /* (DOM0) bytes received on emergency console. */
+#define VIRQ_DOM_EXC    4  /* (DOM0) Exceptional event for some domain.   */
+#define VIRQ_PARITY_ERR 5  /* (DOM0) NMI parity error.                    */
+#define VIRQ_IO_ERR     6  /* (DOM0) NMI I/O error.                       */
+#define NR_VIRQS        7
+
+/*
+ * MMU-UPDATE REQUESTS
+ * 
+ * HYPERVISOR_mmu_update() accepts a list of (ptr, val) pairs.
+ * ptr[1:0] specifies the appropriate MMU_* command.
+ * 
+ * FOREIGN DOMAIN (FD)
+ * -------------------
+ *  Some commands recognise an explicitly-declared foreign domain,
+ *  in which case they will operate with respect to the foreigner rather than
+ *  the calling domain. Where the FD has some effect, it is described below.
+ * 
+ * ptr[1:0] == MMU_NORMAL_PT_UPDATE:
+ * Updates an entry in a page table. If updating an L1 table, and the new
+ * table entry is valid/present, the mapped frame must belong to the FD, if
+ * an FD has been specified. If attempting to map an I/O page then the
+ * caller assumes the privilege of the FD.
+ * FD == DOMID_IO: Permit /only/ I/O mappings, at the priv level of the caller.
+ * FD == DOMID_XEN: Map restricted areas of Xen's heap space.
+ * ptr[:2]  -- Machine address of the page-table entry to modify.
+ * val      -- Value to write.
+ * 
+ * ptr[1:0] == MMU_MACHPHYS_UPDATE:
+ * Updates an entry in the machine->pseudo-physical mapping table.
+ * ptr[:2]  -- Machine address within the frame whose mapping to modify.
+ *             The frame must belong to the FD, if one is specified.
+ * val      -- Value to write into the mapping entry.
+ *  
+ * ptr[1:0] == MMU_EXTENDED_COMMAND:
+ * val[7:0] -- MMUEXT_* command.
+ * 
+ *   val[7:0] == MMUEXT_(UN)PIN_*_TABLE:
+ *   ptr[:2]  -- Machine address of frame to be (un)pinned as a p.t. page.
+ *               The frame must belong to the FD, if one is specified.
+ * 
+ *   val[7:0] == MMUEXT_NEW_BASEPTR:
+ *   ptr[:2]  -- Machine address of new page-table base to install in MMU.
+ * 
+ *   val[7:0] == MMUEXT_TLB_FLUSH:
+ *   No additional arguments.
+ * 
+ *   val[7:0] == MMUEXT_INVLPG:
+ *   ptr[:2]  -- Linear address to be flushed from the TLB.
+ * 
+ *   val[7:0] == MMUEXT_FLUSH_CACHE:
+ *   No additional arguments. Writes back and flushes cache contents.
+ * 
+ *   val[7:0] == MMUEXT_SET_LDT:
+ *   ptr[:2]  -- Linear address of LDT base (NB. must be page-aligned).
+ *   val[:8]  -- Number of entries in LDT.
+ * 
+ *   val[7:0] == MMUEXT_TRANSFER_PAGE:
+ *   val[31:16] -- Domain to whom page is to be transferred.
+ *   (val[15:8],ptr[9:2]) -- 16-bit reference into transferee's grant table.
+ *   ptr[:12]  -- Page frame to be reassigned to the FD.
+ *                (NB. The frame must currently belong to the calling domain).
+ * 
+ *   val[7:0] == MMUEXT_SET_FOREIGNDOM:
+ *   val[31:16] -- Domain to set as the Foreign Domain (FD).
+ *                 (NB. DOMID_SELF is not recognised)
+ *                 If FD != DOMID_IO then the caller must be privileged.
+ * 
+ *   val[7:0] == MMUEXT_CLEAR_FOREIGNDOM:
+ *   Clears the FD.
+ * 
+ *   val[7:0] == MMUEXT_REASSIGN_PAGE:
+ *   ptr[:2]  -- A machine address within the page to be reassigned to the FD.
+ *               (NB. page must currently belong to the calling domain).
+ */
+#define MMU_NORMAL_PT_UPDATE     0 /* checked '*ptr = val'. ptr is MA.       */
+#define MMU_MACHPHYS_UPDATE      2 /* ptr = MA of frame to modify entry for  */
+#define MMU_EXTENDED_COMMAND     3 /* least 8 bits of val demux further      */
+#define MMUEXT_PIN_L1_TABLE      0 /* ptr = MA of frame to pin               */
+#define MMUEXT_PIN_L2_TABLE      1 /* ptr = MA of frame to pin               */
+#define MMUEXT_PIN_L3_TABLE      2 /* ptr = MA of frame to pin               */
+#define MMUEXT_PIN_L4_TABLE      3 /* ptr = MA of frame to pin               */
+#define MMUEXT_UNPIN_TABLE       4 /* ptr = MA of frame to unpin             */
+#define MMUEXT_NEW_BASEPTR       5 /* ptr = MA of new pagetable base         */
+#define MMUEXT_TLB_FLUSH         6 /* ptr = NULL                             */
+#define MMUEXT_INVLPG            7 /* ptr = VA to invalidate                 */
+#define MMUEXT_FLUSH_CACHE       8
+#define MMUEXT_SET_LDT           9 /* ptr = VA of table; val = # entries     */
+#define MMUEXT_SET_FOREIGNDOM   10 /* val[31:16] = dom                       */
+#define MMUEXT_CLEAR_FOREIGNDOM 11
+#define MMUEXT_TRANSFER_PAGE    12 /* ptr = MA of frame; val[31:16] = dom    */
+#define MMUEXT_REASSIGN_PAGE    13
+#define MMUEXT_CMD_MASK        255
+#define MMUEXT_CMD_SHIFT         8
+
+/* These are passed as 'flags' to update_va_mapping. They can be ORed. */
+#define UVMF_FLUSH_TLB          1 /* Flush entire TLB. */
+#define UVMF_INVLPG             2 /* Flush the VA mapping being updated. */
+
+
+/*
+ * Commands to HYPERVISOR_sched_op().
+ */
+#define SCHEDOP_yield           0   /* Give up the CPU voluntarily.       */
+#define SCHEDOP_block           1   /* Block until an event is received.  */
+#define SCHEDOP_shutdown        2   /* Stop executing this domain.        */
+#define SCHEDOP_cmdmask       255   /* 8-bit command. */
+#define SCHEDOP_reasonshift     8   /* 8-bit reason code. (SCHEDOP_shutdown) */
+
+/*
+ * Commands to HYPERVISOR_console_io().
+ */
+#define CONSOLEIO_write         0
+#define CONSOLEIO_read          1
+
+/*
+ * Commands to HYPERVISOR_dom_mem_op().
+ */
+#define MEMOP_increase_reservation 0
+#define MEMOP_decrease_reservation 1
+
+/*
+ * Commands to HYPERVISOR_vm_assist().
+ */
+#define VMASST_CMD_enable                0
+#define VMASST_CMD_disable               1
+#define VMASST_TYPE_4gb_segments         0
+#define VMASST_TYPE_4gb_segments_notify  1
+#define VMASST_TYPE_writable_pagetables  2
+#define MAX_VMASST_TYPE 2
+
+#ifndef __ASSEMBLY__
+
+typedef u16 domid_t;
+
+/* Domain ids >= DOMID_FIRST_RESERVED cannot be used for ordinary domains. */
+#define DOMID_FIRST_RESERVED (0x7FF0U)
+
+/* DOMID_SELF is used in certain contexts to refer to oneself. */
+#define DOMID_SELF (0x7FF0U)
+
+/*
+ * DOMID_IO is used to restrict page-table updates to mapping I/O memory.
+ * Although no Foreign Domain need be specified to map I/O pages, DOMID_IO
+ * is useful to ensure that no mappings to the OS's own heap are accidentally
+ * installed. (e.g., in Linux this could cause havoc as reference counts
+ * aren't adjusted on the I/O-mapping code path).
+ * This only makes sense in MMUEXT_SET_FOREIGNDOM, but in that context can
+ * be specified by any calling domain.
+ */
+#define DOMID_IO   (0x7FF1U)
+
+/*
+ * DOMID_XEN is used to allow privileged domains to map restricted parts of
+ * Xen's heap space (e.g., the machine_to_phys table).
+ * This only makes sense in MMUEXT_SET_FOREIGNDOM, and is only permitted if
+ * the caller is privileged.
+ */
+#define DOMID_XEN  (0x7FF2U)
+
+/*
+ * Send an array of these to HYPERVISOR_mmu_update().
+ * NB. The fields are natural pointer/address size for this architecture.
+ */
+typedef struct
+{
+    memory_t ptr;    /* Machine address of PTE. */
+    memory_t val;    /* New contents of PTE.    */
+} PACKED mmu_update_t;
+
+/*
+ * Send an array of these to HYPERVISOR_multicall().
+ * NB. The fields are natural register size for this architecture.
+ */
+typedef struct
+{
+    cpureg_t op;
+    cpureg_t args[7];
+} PACKED multicall_entry_t;
+
+/* Event channel endpoints per domain. */
+#define NR_EVENT_CHANNELS 1024
+
+/* No support for multi-processor guests. */
+#define MAX_VIRT_CPUS 1
+
+/*
+ * Xen/guestos shared data -- pointer provided in start_info.
+ * NB. We expect that this struct is smaller than a page.
+ */
+typedef struct shared_info_st
+{
+    /*
+     * Per-VCPU information goes here. This will be cleaned up more when Xen 
+     * actually supports multi-VCPU guests.
+     */
+    struct {
+        /*
+         * 'evtchn_upcall_pending' is written non-zero by Xen to indicate
+         * a pending notification for a particular VCPU. It is then cleared 
+         * by the guest OS /before/ checking for pending work, thus avoiding
+         * a set-and-check race. Note that the mask is only accessed by Xen
+         * on the CPU that is currently hosting the VCPU. This means that the
+         * pending and mask flags can be updated by the guest without special
+         * synchronisation (i.e., no need for the x86 LOCK prefix).
+         * This may seem suboptimal because if the pending flag is set by
+         * a different CPU then an IPI may be scheduled even when the mask
+         * is set. However, note:
+         *  1. The task of 'interrupt holdoff' is covered by the per-event-
+         *     channel mask bits. A 'noisy' event that is continually being
+         *     triggered can be masked at source at this very precise
+         *     granularity.
+         *  2. The main purpose of the per-VCPU mask is therefore to restrict
+         *     reentrant execution: whether for concurrency control, or to
+         *     prevent unbounded stack usage. Whatever the purpose, we expect
+         *     that the mask will be asserted only for short periods at a time,
+         *     and so the likelihood of a 'spurious' IPI is suitably small.
+         * The mask is read before making an event upcall to the guest: a
+         * non-zero mask therefore guarantees that the VCPU will not receive
+         * an upcall activation. The mask is cleared when the VCPU requests
+         * to block: this avoids wakeup-waiting races.
+         */
+        u8 evtchn_upcall_pending;
+        u8 evtchn_upcall_mask;
+        u8 pad0, pad1;
+    } PACKED vcpu_data[MAX_VIRT_CPUS];  /*   0 */
+
+    /*
+     * A domain can have up to 1024 "event channels" on which it can send
+     * and receive asynchronous event notifications. There are three classes
+     * of event that are delivered by this mechanism:
+     *  1. Bi-directional inter- and intra-domain connections. Domains must
+     *     arrange out-of-band to set up a connection (usually the setup
+     *     is initiated and organised by a privileged third party such as
+     *     software running in domain 0).
+     *  2. Physical interrupts. A domain with suitable hardware-access
+     *     privileges can bind an event-channel port to a physical interrupt
+     *     source.
+     *  3. Virtual interrupts ('events'). A domain can bind an event-channel
+     *     port to a virtual interrupt source, such as the virtual-timer
+     *     device or the emergency console.
+     * 
+     * Event channels are addressed by a "port index" between 0 and 1023.
+     * Each channel is associated with two bits of information:
+     *  1. PENDING -- notifies the domain that there is a pending notification
+     *     to be processed. This bit is cleared by the guest.
+     *  2. MASK -- if this bit is clear then a 0->1 transition of PENDING
+     *     will cause an asynchronous upcall to be scheduled. This bit is only
+     *     updated by the guest. It is read-only within Xen. If a channel
+     *     becomes pending while the channel is masked then the 'edge' is lost
+     *     (i.e., when the channel is unmasked, the guest must manually handle
+     *     pending notifications as no upcall will be scheduled by Xen).
+     * 
+     * To expedite scanning of pending notifications, any 0->1 pending
+     * transition on an unmasked channel causes a corresponding bit in a
+     * 32-bit selector to be set. Each bit in the selector covers a 32-bit
+     * word in the PENDING bitfield array.
+     */
+    u32 evtchn_pending[32];             /*   4 */
+    u32 evtchn_pending_sel;             /* 132 */
+    u32 evtchn_mask[32];                /* 136 */
+
+    /*
+     * Time: The following abstractions are exposed: System Time, Clock Time,
+     * Domain Virtual Time. Domains can access Cycle counter time directly.
+     */
+    u64                cpu_freq;        /* 264: CPU frequency (Hz).          */
+
+    /*
+     * The following values are updated periodically (and not necessarily
+     * atomically!). The guest OS detects this because 'time_version1' is
+     * incremented just before updating these values, and 'time_version2' is
+     * incremented immediately after. See the Xen-specific Linux code for an
+     * example of how to read these values safely (arch/xen/kernel/time.c).
+     */
+    u32                time_version1;   /* 272 */
+    u32                time_version2;   /* 276 */
+    tsc_timestamp_t    tsc_timestamp;   /* TSC at last update of time vals.  */
+    u64                system_time;     /* Time, in nanosecs, since boot.    */
+    u32                wc_sec;          /* Secs  00:00:00 UTC, Jan 1, 1970.  */
+    u32                wc_usec;         /* Usecs 00:00:00 UTC, Jan 1, 1970.  */
+    u64                domain_time;     /* Domain virtual time, in nanosecs. */
+
+    /*
+     * Timeout values:
+     * Allow a domain to specify a timeout value in system time and 
+     * domain virtual time.
+     */
+    u64                wall_timeout;    /* 312 */
+    u64                domain_timeout;  /* 320 */
+
+    arch_shared_info_t arch;
+
+} PACKED shared_info_t;
+
+/*
+ * Start-of-day memory layout for the initial domain (DOM0):
+ *  1. The domain is started within contiguous virtual-memory region.
+ *  2. The contiguous region begins and ends on an aligned 4MB boundary.
+ *  3. The region start corresponds to the load address of the OS image.
+ *     If the load address is not 4MB aligned then the address is rounded down.
+ *  4. This the order of bootstrap elements in the initial virtual region:
+ *      a. relocated kernel image
+ *      b. initial ram disk              [mod_start, mod_len]
+ *      c. list of allocated page frames [mfn_list, nr_pages]
+ *      d. bootstrap page tables         [pt_base, CR3 (x86)]
+ *      e. start_info_t structure        [register ESI (x86)]
+ *      f. bootstrap stack               [register ESP (x86)]
+ *  5. Bootstrap elements are packed together, but each is 4kB-aligned.
+ *  6. The initial ram disk may be omitted.
+ *  7. The list of page frames forms a contiguous 'pseudo-physical' memory
+ *     layout for the domain. In particular, the bootstrap virtual-memory
+ *     region is a 1:1 mapping to the first section of the pseudo-physical map.
+ *  8. All bootstrap elements are mapped read-writable for the guest OS. The
+ *     only exception is the bootstrap page table, which is mapped read-only.
+ *  9. There is guaranteed to be at least 512kB padding after the final
+ *     bootstrap element. If necessary, the bootstrap virtual region is
+ *     extended by an extra 4MB to ensure this.
+ */
+
+#define MAX_CMDLINE 256
+typedef struct {
+    /* THE FOLLOWING ARE FILLED IN BOTH ON INITIAL BOOT AND ON RESUME.     */
+    memory_t nr_pages;        /*  0: Total pages allocated to this domain. */
+    _MEMORY_PADDING(A);
+    memory_t shared_info;     /*  8: MACHINE address of shared info struct.*/
+    _MEMORY_PADDING(B);
+    u32      flags;           /* 16: SIF_xxx flags.                        */
+    u16      domain_controller_evtchn; /* 20 */
+    u16      __pad;
+    /* THE FOLLOWING ARE ONLY FILLED IN ON INITIAL BOOT (NOT RESUME).      */
+    memory_t pt_base;         /* 24: VIRTUAL address of page directory.    */
+    _MEMORY_PADDING(C);
+    memory_t nr_pt_frames;    /* 32: Number of bootstrap p.t. frames.      */
+    _MEMORY_PADDING(D);
+    memory_t mfn_list;        /* 40: VIRTUAL address of page-frame list.   */
+    _MEMORY_PADDING(E);
+    memory_t mod_start;       /* 48: VIRTUAL address of pre-loaded module. */
+    _MEMORY_PADDING(F);
+    memory_t mod_len;         /* 56: Size (bytes) of pre-loaded module.    */
+    _MEMORY_PADDING(G);
+    u8 cmd_line[MAX_CMDLINE]; /* 64 */
+} PACKED start_info_t; /* 320 bytes */
+
+/* These flags are passed in the 'flags' field of start_info_t. */
+#define SIF_PRIVILEGED    (1<<0)  /* Is the domain privileged? */
+#define SIF_INITDOMAIN    (1<<1)  /* Is this the initial control domain? */
+#define SIF_BLK_BE_DOMAIN (1<<4)  /* Is this a block backend domain? */
+#define SIF_NET_BE_DOMAIN (1<<5)  /* Is this a net backend domain? */
+
+/* For use in guest OSes. */
+extern shared_info_t *HYPERVISOR_shared_info;
+
+#endif /* !__ASSEMBLY__ */
+
+#endif /* __XEN_PUBLIC_XEN_H__ */
index bbacae6e4c1dde5111ed2a33ba207c274f8bb020..eb9d8c15af02e00815e4730c9e34bc49fa2a63c6 100644 (file)
@@ -26,7 +26,7 @@
 
 #include <xen/config.h>
 #include <xen/mm.h>
-#include <hypervisor-ifs/grant_table.h>
+#include <public/grant_table.h>
 
 /* Active grant entry - used for shadowing GTF_permit_access grants. */
 typedef struct {
@@ -68,7 +68,7 @@ typedef struct {
 
 /* Per-domain grant information. */
 typedef struct {
-    /* Shared grant table (see include/hypervisor-ifs/grant_table.h). */
+    /* Shared grant table (see include/public/grant_table.h). */
     grant_entry_t        *shared;
     /* Active grant table. */
     active_grant_entry_t *active;
index 7c1e7bc909c921ae91d96e23d259b8e866a8290c..6eba6ab42505a81fd9a61ef07936080ebd46f113 100644 (file)
@@ -10,8 +10,8 @@
 #include <xen/smp.h>
 #include <asm/page.h>
 #include <asm/processor.h>
-#include <hypervisor-ifs/hypervisor-if.h>
-#include <hypervisor-ifs/dom0_ops.h>
+#include <public/xen.h>
+#include <public/dom0_ops.h>
 #include <xen/list.h>
 #include <xen/time.h>
 #include <xen/ac_timer.h>
index 79ddb92309199f7f7652cf0de0a9c5abccb16b71..dd476f9298c1a45d09d0ddc294b94465ccf24bf5 100644 (file)
@@ -28,7 +28,7 @@
 #define __XEN_TIME_H__
 
 #include <xen/types.h>
-#include <hypervisor-ifs/hypervisor-if.h>
+#include <public/xen.h>
 
 extern int init_xen_time();
 
index 3064c47a0bbb35a12f78b003db10efdf43b89f5f..88c0b23d39fe9290bfdde4c02ab77d90398967e2 100644 (file)
  * Access to the trace buffers is via a dom0 hypervisor op and analysis of
  * trace buffer contents can then be performed using a userland tool.
  *
- * See also common/trace.c and the dom0 op in include/hypervisor-ifs/dom0_ops.h
+ * See also common/trace.c and the dom0 op in include/public/dom0_ops.h
  */
 
 #ifndef __XEN_TRACE_H__
 #define __XEN_TRACE_H__
 
-#include <hypervisor-ifs/trace.h>
+#include <public/trace.h>
 
 #ifdef TRACE_BUFFER
 
@@ -32,7 +32,7 @@
 #include <asm/atomic.h>
 #include <asm/current.h>
 #include <asm/msr.h>
-#include <hypervisor-ifs/dom0_ops.h>
+#include <public/dom0_ops.h>
 
 /* Used to initialise trace buffer functionality */
 void init_trace_bufs(void);